Opened 17 years ago
Closed 15 years ago
#7995 closed (fixed)
url template tag uses low level parser
| Reported by: | jrocha | Owned by: | jrocha |
|---|---|---|---|
| Component: | Template system | Version: | dev |
| Severity: | Keywords: | url | |
| Cc: | Triage Stage: | Accepted | |
| Has patch: | yes | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description
The URL template tag does not allow more than one space separating each of its components (template name and arguments). Also, one must use a comma to separate the arguments and argument separation by spaces is also not allowed. This makes the use a little annoying and restrictive.
I am including a patch that will allow separation of url from its arguments by use of spaces (using split_contents). I also did it in a way so it is compatible with the usual way of arguments separation by a comma - retrocompatible.
Attachments (1)
Change History (4)
by , 17 years ago
| Attachment: | url_tag_improvement.diff added |
|---|
comment:1 by , 17 years ago
| Status: | new → assigned |
|---|
comment:2 by , 17 years ago
#7806 would address the whitespace issues. Allowing space separated arguments would be consistent with {% cycle %}, but you'd loose the visual separation of viewname and args.
I'd like a more consistent syntax for templatetags -- x=foo vs foo as x or a,b vs a b vs a and b -- ideally there should be only one way to do this. But as it looks now, this won't be fixed before 2.0 -- if at all.
the patch for this ticket