Django

Code

Ticket #3826 (closed: wontfix)

Opened 2 years ago

Last modified 1 year ago

`{% with %}` template tag

Reported by: SmileyChris Assigned to: adrian
Milestone: Component: Template system
Version: SVN Keywords:
Cc: Triage Stage: Design decision needed
Has patch: 1 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

Description

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

Attachments

with_tag.patch (3.4 kB) - added by SmileyChris on 03/26/07 15:48:55.
with tests and docs
with_template_tag.patch (4.0 kB) - added by michelts@gmail.com on 04/02/07 12:30:02.

Change History

03/26/07 15:48:55 changed by SmileyChris

  • attachment with_tag.patch added.

with tests and docs

03/26/07 16:54:14 changed by Simon G. <dev@simon.net.nz>

  • needs_better_patch changed.
  • stage changed from Unreviewed to Ready for checkin.
  • needs_tests changed.
  • needs_docs changed.

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

03/27/07 12:25:57 changed by jacob

  • status changed from new to closed.
  • resolution set to fixed.

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

04/02/07 12:30:02 changed by michelts@gmail.com

  • attachment with_template_tag.patch added.

04/02/07 12:30:26 changed by michelts@gmail.com

  • status changed from closed to reopened.
  • needs_better_patch set to 1.
  • resolution deleted.

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 %}

04/02/07 18:28:59 changed by SmileyChris

  • needs_better_patch deleted.
  • 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.

04/24/07 02:48:43 changed by mtredinnick

  • status changed from reopened to closed.
  • resolution set to wontfix.

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


Add/Change #3826 (`{% with %}` template tag)




Change Properties
Action