Reputation: 1249
HI i am using a forloop in django template
{% for image in images %}
{% endfor %}
which executes for 10 steps
but i want to skip the 5th step and execute for remaining how can i do this please suggest ...
Upvotes: 0
Views: 1040
Reputation: 1249
{% for image in images %}
{% if forloop.counter0 != 5 %}
...
{% endif %}
{% endfor %}
this works for me
Upvotes: 0
Reputation: 62948
{% for image in images %}
{% if forloop.counter != 5 %}
...
{% endif %}
{% endfor %}
https://docs.djangoproject.com/en/dev/ref/templates/builtins/#for
Upvotes: 5