If we have simple for loop in Jinja2 template:

{% for item in items %}
<li>
    {{ item }}</span>
</li>
{% endfor %}

"items" set contains random count of items. How can I add additional, empty 
<li/> tags if I need to make sure, there will be added at least 5 
(10,15,20...) <li/> tags?

I think the solution should be something similar to this:

{% for item in items %}
<li>
    {{ item }}</span>
</li>
{% endfor %}

{% for item in [RANGE?] if items|length % 5 %}
    <li>{{ item }}</li>
{% endfor %}

Thanks!

-- 
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.

Reply via email to