#17492: url backreferencing can not be reversed.
------------------------------+--------------------------------------
Reporter: nate_b | Owner: nate_b
Type: Bug | Status: assigned
Component: Core (Other) | Version: 1.3
Severity: Normal | Resolution:
Keywords: | Triage Stage: Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
------------------------------+--------------------------------------
Comment (by nate_b):
After being encouraged to on IRC - here's my rationale:
I had something like this in my urlpatterns:
{{{
url(r'^static_text/(?P<group_one>[a-z][a-z_]*)/(?P<group_two>\d+)/(?P=group_one)_(?P=group_two)_(?P<group_three>\w+)/$',
views.a_view)
}}}
Because "(?P=" wasn't being parsed, it was choking on reversing... a
DIFFERENT pattern. So, I figured the right thing to do would be to
recognize this pattern too, since backreferences are so simple (i.e., they
have to only have an identifier name between '=' and ')', and that
identifier name had to previously have occurred).
Now, in my patch, I don't check that the backreference actually occurred!
BUT - that's okay, because if your url pattern has that problem, it didn't
compile anyhow, and you never got to 'reverse' anyhow (that, and I
reasoned that this behavior is in line with other omissions that
'normalize' allows).
--
Ticket URL: <https://code.djangoproject.com/ticket/17492#comment:3>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en.