Opened 18 years ago
Last modified 17 years ago
#3525 closed
{% url path.to.view %} fails with multiple patterns for the same function — at Version 2
Reported by: | Owned by: | Malcolm Tredinnick | |
---|---|---|---|
Component: | Template system | Version: | dev |
Severity: | Keywords: | url, template | |
Cc: | django@… | Triage Stage: | Accepted |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description (last modified by )
If there are multiple patterns matching the same view function, it seems like, only the first match is considered.
Lets say a function has an optional "id" parameter which defaults to None and below is the patterns pointing that function.
(r'^(?P<slug>[-\w]+)/$', views.myfunc), (r'^(?P<slug>[-\w]+)/(?P<id>\d+)/$', views.myfunc),
In that case,
{% url views.myfunc slug=something,id=someint %}
fails to match anything, where we can expect it to match the second
pattern and return "/something/someint/"
Change History (2)
comment:1 by , 18 years ago
Triage Stage: | Unreviewed → Design decision needed |
---|
comment:2 by , 18 years ago
Description: | modified (diff) |
---|---|
Owner: | changed from | to
Status: | new → assigned |
Note:
See TracTickets
for help on using tickets.
Yep. A bug.