Opened 18 years ago

Closed 18 years ago

#3826 closed (wontfix)

`{% with %}` template tag

Reported by: Chris Beaven Owned by: Adrian Holovaty
Component: Template system Version: dev
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

Description

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 18 years ago.
with tests and docs
with_template_tag.patch (4.0 KB ) - added by michelts@… 18 years ago.

Download all attachments as: .zip

Change History (7)

by Chris Beaven, 18 years ago

Attachment: with_tag.patch added

with tests and docs

comment:1 by Simon G. <dev@…>, 18 years ago

Triage Stage: UnreviewedReady for checkin

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

comment:2 by Jacob, 18 years ago

Resolution: fixed
Status: newclosed

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

by michelts@…, 18 years ago

Attachment: with_template_tag.patch added

comment:3 by michelts@…, 18 years ago

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

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 by Malcolm Tredinnick, 18 years ago

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