Opened 5 years ago

Closed 5 years ago

#12906 closed (wontfix)

Should the url template tag accepts a variable?

Reported by: terrex 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: UI/UX:

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 terrex 5 years ago.

Download all attachments as: .zip

Change History (3)

Changed 5 years ago by terrex

comment:1 Changed 5 years ago by terrex

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

I'd meant staff users not stuff people.

comment:2 Changed 5 years ago by russellm

  • Resolution set to wontfix
  • Status changed from new to 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.

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