Code

Opened 6 years ago

Closed 4 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:

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 6 years ago.
the patch for this ticket

Download all attachments as: .zip

Change History (4)

Changed 6 years ago by jrocha

the patch for this ticket

comment:1 Changed 6 years ago by jrocha

  • Status changed from new to assigned

comment:2 Changed 6 years ago by emulbreh

#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 4 years ago by mk

  • Resolution set to fixed
  • Status changed from assigned to closed

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

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.