Perhaps this is useful: http://www.djangosnippets.org/snippets/546/
It even has a ticket: http://code.djangoproject.com/ticket/6398 with,
of course, ensuing discussion.
>
> I was looking at jinja[1] and there was one feature which I really
> liked
> "for loops have an optional else block exe
I was looking at jinja[1] and there was one feature which I really
liked
"for loops have an optional else block executed if there was no
iteration."
Right now most of my for loops are like,
{% if comments %}
{% for comment in comments %}
{{comment}}
{% endfor %}
{% else %}
There are no comment
2 matches
Mail list logo