E.g.
{{{
path('articles/<slug>/', …)
}}}
would only match a slug, and would pass the value on as "slug".
(As seen here:
https://docs.djangoproject.com/en/dev/topics/http/urls/#example )
This is wrong, as mentioned below (easy to miss, if you're eager to test
stuff out):
{{{
If a converter isn’t included, any string, excluding a / character, is
matched.
}}}
----
However it doesn't help, that the example uses "slug" as a name, and
states
{{{
/articles/2003/03/building-a-django-site/
}}}
would match the last example, even though
{{{
/articles/2003/03/building+a~django@site/
}}}
would match it just as well.
----
Simple fix would be to just change the example from
{{{
articles/<int:year>/<int:month>/<slug>/
}}}
to
{{{
articles/<int:year>/<int:month>/<slug:slug>/
}}}
because I suppose the implicit converter types aren't a feature of 2.0.
(If someone points me to the right repo, I can do the little documentation
change myself)
--
Ticket URL: <https://code.djangoproject.com/ticket/28627>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* has_patch: 0 => 1
--
Ticket URL: <https://code.djangoproject.com/ticket/28627#comment:1>
* status: new => closed
* resolution: => fixed
Comment:
In [changeset:"6da140724dba546d2f3aced1308e617747b0385c" 6da1407]:
{{{
#!CommitTicketReference repository=""
revision="6da140724dba546d2f3aced1308e617747b0385c"
Fixed #28627 -- Added slug converter to some path() examples in docs.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/28627#comment:2>
Comment (by Tim Graham <timograham@…>):
In [changeset:"ecea60fee884bc41613b8afcb4cca39c8f2fa538" ecea60f]:
{{{
#!CommitTicketReference repository=""
revision="ecea60fee884bc41613b8afcb4cca39c8f2fa538"
[2.0.x] Fixed #28627 -- Added slug converter to some path() examples in
docs.
Backport of 6da140724dba546d2f3aced1308e617747b0385c from master
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/28627#comment:3>