On Thu, Dec 1, 2011 at 5:35 PM, Mark Gajdosik <[email protected]
> wrote:
> Hi there,
>
> although this might have been answered several times, I hope you won't
> mind me asking:
>
> {% set count = 0 %}
> {% for i in range(10) %}
> {% set count = count + 1 %}
> {% endfor %}
>
> {{ count }}
> {# Display's 0. #}
>
> Why is this not working? I am aware that the loop variable could be used
> to achieve this, but
> what if the counter I have is conditional, i.e. incremented only if a
> certain condition is true.
>
>
http://stackoverflow.com/questions/4870346/can-a-jinja-variables-scope-extend-beyond-in-an-inner-block
--
You received this message because you are subscribed to the Google Groups
"pocoo-libs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/pocoo-libs?hl=en.