Code

Opened 4 years ago

Closed 4 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 4 years ago.

Download all attachments as: .zip

Change History (3)

Changed 4 years ago by terrex

comment:1 Changed 4 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 4 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.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.