Code

Opened 6 years ago

Closed 6 years ago

#9070 closed (invalid)

the value of parse_until will be overwritten when using a block in a loop of {%include%}

Reported by: ledil <leonardo@…> Owned by: nobody
Component: Template system Version: 0.96
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description (last modified by adrian)

Ive tried the columnize tag (http://code.djangoproject.com/wiki/ColumnizeTag) in my template. Everything works if I use it in one template file:

#mytemplate.html

{% load columnize %}
{% for item in items %}
{%columnize 13%}
<img src="{{item.src}}"/>
{%endcolumnize%}
{% endfor %}

But the problem is when I put the stuff in the {%for%}-loop in an external template file like this:

#myinternalloop.html
{% load columnize %}
{% columnize 13%}
<img src="{{item.src}}"/>
{% endcolumnize%}

#mytemplate.html

{% for item in items %}
{% include "myinternalloop.html" %}
{% endfor %}

I've tried to debug and it seems that "parse_until" seems to lose {% endcolumnize %} and this results in that columnize will never start again when traversing a new item. It will continue there where it stops on the previous item. (init.py of ColumnizeNode will not be called)

Attachments (0)

Change History (2)

comment:1 Changed 6 years ago by adrian

  • Description modified (diff)
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

(Fixed formatting in description.)

comment:2 Changed 6 years ago by mtredinnick

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

This isn't a bug with Django. Anybody can contribute pages to the wiki and we can't effectively maintain them if people don't keep them up to date. Unfortunately, they aren't marked with who contributed them always.

So there's nothing we can really do here. This looks to be a bug in the implementation of that tag, not a bug in Django itself.

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.