Opened 16 years ago
Closed 16 years ago
#9239 closed (wontfix)
Better reverse() handling for the (.*) pattern
Reported by: | Malcolm Tredinnick | Owned by: | Malcolm Tredinnick |
---|---|---|---|
Component: | Core (Other) | Version: | 1.0 |
Severity: | Keywords: | ||
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
Right now, if you have (.*)
in a URL pattern, calling reverse()
or {% url... %}
requires you to pass in an empty string argument. But this is really an optional argument, since it successfully matches nothing. It would be nice if reverse URL resolving understood that case and allowed for no parameter to be passed in.
Change History (7)
comment:1 by , 16 years ago
Resolution: | → wontfix |
---|---|
Status: | new → closed |
comment:2 by , 16 years ago
Resolution: | wontfix → fixed |
---|
comment:3 by , 16 years ago
comment:4 by , 16 years ago
Above commit messages were typos. They should have referred to bug #9329.
comment:5 by , 16 years ago
Does that mean this should still be resolved wontfix? The issue is still apparent in my testing.
comment:7 by , 16 years ago
Resolution: | → wontfix |
---|---|
Status: | reopened → closed |
Now that I look at the code, this would be unnecessarily fiddly to handle. We currently can completely ignore the contents of capturing groups and having to process them just for a few special cases would be extra work for no huge benefit.
Turns out that
(.*)?
would work as a pattern if somebody didn't want to have to pass in empty arguments. So wontfix-ing my own ticket, upon reflection.