Opened 7 years ago

Closed 7 years ago

#3826 closed (wontfix)

`{% with %}` template tag

Reported by: SmileyChris Owned by: adrian
Component: Template system Version: master
Severity: Keywords:
Cc: Triage Stage: Design decision needed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:


Following on from the related discussion, here's a ticket for the {% with %} tag.

Attachments (2)

with_tag.patch (3.4 KB) - added by SmileyChris 7 years ago.
with tests and docs
with_template_tag.patch (4.0 KB) - added by michelts@… 7 years ago.

Download all attachments as: .zip

Change History (7)

Changed 7 years ago by SmileyChris

with tests and docs

comment:1 Changed 7 years ago by Simon G. <dev@…>

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Ready for checkin

ready-for-checkin as per discussion on django-dev.

comment:2 Changed 7 years ago by jacob

  • Resolution set to fixed
  • Status changed from new to closed

(In [4830]) Fixed #3826: added a {% with %}. Thanks, SmileyChris.

Changed 7 years ago by michelts@…

comment:3 Changed 7 years ago by michelts@…

  • Patch needs improvement set
  • Resolution fixed deleted
  • Status changed from closed to reopened

To use the with tag for more than one variable I need to nest the tags as follow:

{% with var1 as name1 %}
{% with var2 as name2 %}
{% with var3 as name 3 %}
{% endwith %}
{% endwith %}
{% endwith %}

This is ugly, cost much typing and can be such confusing, I've done a patch to use one with tag to many variables I want to define, see:

{% with var1 as name1 and var2 as name2 and var3 as name3 %}
{% endwith %}

comment:4 Changed 7 years ago by SmileyChris

  • Patch needs improvement unset
  • Triage Stage changed from Ready for checkin to Design decision needed

Michelts, I'll leave this ticket open, but in the future if you are suggesting enhancement to something that has already been fixed then please open a new ticket.

comment:5 Changed 7 years ago by mtredinnick

  • Resolution set to wontfix
  • Status changed from reopened to closed

The more compact form is not greatly more readable. Let's leave it as nested tags.

Add Comment

Modify Ticket

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

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

Note: See TracTickets for help on using tickets.