Restore this message to provide solutions using only the template language.
, {% for %} ( ), forloop.parentloop. , , , , (forloop.parentloop.parentloop...).
{% for foo in foos %}
{% for bar in bars %} {
{{ forloop.parentloop.counter0 }} is the index of foo.
{% endfor %}
{% endfor %}
(, , , django-crispy-forms), :
{% for foo in foos %}
{% with foo_num=forloop.counter0 %}
{% for bar in bars %} {
{{ foo_num }} is the index of foo.
{% endfor %}
{% endwith %}
{% endfor %}
Falsetru , for, , , . , itertools falsetru.
{% for foo in foos %}
{{ counter }} is the index of foo
{% endfor %}
{% for bar in bars %}
{{ counter }} is the index of bar + len(foos)
{% endfor %}