Opened 12 years ago

Closed 12 years ago

#3826 closed (wontfix)

`{% with %}` template tag

Reported by: Chris Beaven Owned by: Adrian Holovaty
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: no UI/UX: no


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

Attachments (2)

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

Download all attachments as: .zip

Change History (7)

Changed 12 years ago by Chris Beaven

Attachment: with_tag.patch added

with tests and docs

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

Triage Stage: UnreviewedReady for checkin

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

comment:2 Changed 12 years ago by Jacob

Resolution: fixed
Status: newclosed

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

Changed 12 years ago by michelts@…

Attachment: with_template_tag.patch added

comment:3 Changed 12 years ago by michelts@…

Patch needs improvement: set
Resolution: fixed
Status: closedreopened

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 12 years ago by Chris Beaven

Patch needs improvement: unset
Triage Stage: Ready for checkinDesign 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 12 years ago by Malcolm Tredinnick

Resolution: wontfix
Status: reopenedclosed

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

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