Opened 16 years ago

Closed 16 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: no UI/UX: no

Description (last modified by Adrian Holovaty)

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)

Change History (2)

comment:1 by Adrian Holovaty, 16 years ago

Description: modified (diff)

(Fixed formatting in description.)

comment:2 by Malcolm Tredinnick, 16 years ago

Resolution: invalid
Status: newclosed

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.

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