Opened 17 years ago
Closed 13 years ago
#7117 closed Bug (fixed)
Replace backslash in reverse URL matcher
Reported by: | Owned by: | nobody | |
---|---|---|---|
Component: | Core (Other) | Version: | dev |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Design decision needed | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
The reverse URL pattern matcher should replace backslashes
stemming from regex escapes in the result URL.
Added also a test case.
Attachments (1)
Change History (6)
by , 17 years ago
Attachment: | commit-454b8e2 added |
---|
comment:1 by , 17 years ago
Component: | Uncategorized → Core framework |
---|---|
Needs tests: | set |
Triage Stage: | Unreviewed → Design decision needed |
comment:2 by , 17 years ago
Needs tests: | unset |
---|
There is a test case in the patch, it's just very small :)
What is it that needs fixing up in the reverse matcher?
Perhaps it is the fact that the reverse matcher cannot be a (perfect) function, since there might be two or more URLs that resolve to the same view. For example this pattern:
('docs/index[12].doc', 'docs.display')
resolves two different URLs to the exact same view. Same with multiple patterns pointing to the same view:
('docs/index1.doc', 'docs.display') ('docs/index2.doc', 'docs.display')
A reverse function for docs.display
does not exist then. Perhaps {{reverse()}}} should throw ValueError
in these cases to make the user aware of this issue, but that is a more invasive change.
comment:3 by , 17 years ago
Sorry Bastian, i 10 second scanned the patch and overlooked the test :)
The reverse matcher can be much more sane, even if there are multiple cases. My patch the ancient (still open) #2977 ticket covers most cases. But, like I said - yours is a simple fix and a reasonably common case.
comment:4 by , 14 years ago
Severity: | → Normal |
---|---|
Type: | → Bug |
comment:5 by , 13 years ago
Easy pickings: | unset |
---|---|
Resolution: | → fixed |
Status: | new → closed |
UI/UX: | unset |
Fixed (3 years ago in r8760)
There are a lot more things to do to fix up the reverse URL matcher than this, but it is a simple change. I'll push to a design decision.
Should probably have a test case.