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)

allow_variable_in_url_templatetag.diff (1.6 KB ) - added by Guillermo Gutiérrez 15 years ago.

Download all attachments as: .zip

Change History (3)

by Guillermo Gutiérrez, 15 years ago

comment:1 by Guillermo Gutiérrez, 15 years ago

I'd meant staff users not stuff people.

comment:2 by Russell Keith-Magee, 15 years ago

Resolution: wontfix
Status: newclosed

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.

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