Opened 15 years ago
Closed 15 years ago
#12906 closed (wontfix)
Should the url template tag accepts a variable?
Reported by: | Guillermo Gutiérrez | Owned by: | nobody |
---|---|---|---|
Component: | Uncategorized | Version: | 1.1 |
Severity: | Keywords: | ||
Cc: | xiterrex@…, campus-virtual-fueca-django@… | Triage Stage: | Unreviewed |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
This way, you could use a model to describe the elements of a generated menu, i. ex., and lets stuff people to set it from django admin; or whatever:
<li>
{% for entry in menu_entries %}
<a href="{% url entry.view_name %}">{{ entry.description }}</a>
{% endfor %}
</li>
If MenuEntry.view_name is an CharField containing the urlname or path to view like the first argument to django.core.urlresolvers.resolve().
I'll attach my changes to django.template.defaulttags to support it.
Attachments (1)
Change History (3)
by , 15 years ago
Attachment: | allow_variable_in_url_templatetag.diff added |
---|
comment:1 by , 15 years ago
comment:2 by , 15 years ago
Resolution: | → wontfix |
---|---|
Status: | new → closed |
Closing wontfix, or rather "Can't fix". This would be a backwards incompatible change - or at the very least, an amiguous change (since we're moving towards using quotes to describe constants.
I'd meant staff users not stuff people.