Opened 15 years ago

Closed 15 years ago

Last modified 13 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 15 years ago.
patch proposal

Download all attachments as: .zip

Change History (6)

comment:1 by Soviut, 15 years ago

Owner: changed from nobody to Soviut
Status: newassigned

by Soviut, 15 years ago

patch proposal

comment:2 by Soviut, 15 years ago

Has patch: set

comment:3 by Johannes Dollinger, 15 years ago

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 by Russell Keith-Magee, 15 years ago

Resolution: duplicate
Status: assignedclosed

Duplicate of #7917.

comment:5 by Jacob, 13 years ago

milestone: 1.1

Milestone 1.1 deleted

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