i want to compare do simple math in django template
like {% forloop.counter > 5 %} {% endfor %}
how do i achieve this?
i want to compare do simple math in django template
like {% forloop.counter > 5 %} {% endfor %}
how do i achieve this?
You can do that with the if
tag in Django 1.2
{% for blip in blah %}
{% if forloop.counter > 5 %}
{# Do somthing #}
{% endif %}
{% endfor %}
If you are still using an earlier version of Django then you can check out the smart if tag on djangosnippets: http://djangosnippets.org/snippets/1350/