Opened 14 years ago

Closed 14 years ago

Last modified 12 years ago

#10745 closed (duplicate)

url template tag should accept a varible for view name

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


The {% url %} tag only accepts "template strings" as view name/named url. I propose that the view name be a django.template.Variable and resolve() on render.

There are two reasons for this; Firstly, if you accidentally put quotes around the view name a very cryptic template syntax error is raised. Secondly, I've encountered several occasions where it would be useful to be able to pass a view name, or named url, to the url tag as a variable, but found it wouldn't evaluate.

Attachments (1)

url-tag-variable-view-name.diff (1.2 KB) - added by Soviut 14 years ago.
patch proposal

Download all attachments as: .zip

Change History (6)

comment:1 Changed 14 years ago by Soviut

Owner: changed from nobody to Soviut
Status: newassigned

Changed 14 years ago by Soviut

patch proposal

comment:2 Changed 14 years ago by Soviut

Has patch: set

comment:3 Changed 14 years ago by Johannes Dollinger

This has already been rejected, see #7917 (option number 2 there would be a backwards compatible fix for your quote issue).

You could raise this on django-dev (once again) when 1.1 is out the door.

Good luck.

comment:4 Changed 14 years ago by Russell Keith-Magee

Resolution: duplicate
Status: assignedclosed

Duplicate of #7917.

comment:5 Changed 12 years ago by Jacob

milestone: 1.1

Milestone 1.1 deleted

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