Opened 16 years ago

Closed 14 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)

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

Download all attachments as: .zip

Change History (4)

by jrocha, 16 years ago

Attachment: url_tag_improvement.diff added

the patch for this ticket

comment:1 by jrocha, 16 years ago

Status: newassigned

comment:2 by Johannes Dollinger, 16 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.

comment:3 by Matthias Kestenholz, 14 years ago

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