#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: |
Description
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)
Change History (6)
comment:1 by , 16 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
by , 16 years ago
Attachment: | url-tag-variable-view-name.diff added |
---|
comment:2 by , 16 years ago
Has patch: | set |
---|
comment:3 by , 16 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.
patch proposal