Opened 10 years ago

Closed 8 years ago

#7995 closed (fixed)

url template tag uses low level parser

Reported by: jrocha Owned by: jrocha
Component: Template system Version: master
Severity: Keywords: url
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:


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)

url_tag_improvement.diff (1.6 KB) - added by jrocha 10 years ago.
the patch for this ticket

Download all attachments as: .zip

Change History (4)

Changed 10 years ago by jrocha

Attachment: url_tag_improvement.diff added

the patch for this ticket

comment:1 Changed 10 years ago by jrocha

Status: newassigned

comment:2 Changed 10 years ago by Johannes Dollinger

#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.

comment:3 Changed 8 years ago by Matthias Kestenholz

Resolution: fixed
Status: assignedclosed

Has been fixed in the meantime (#9315, #12072, #12945, #13275, ...)

Note: See TracTickets for help on using tickets.
Back to Top