When running the following jinja code, I only get "Column info" printed. Why the index does not appears ?
{% for field in columns_form %}
{% if 'title_' in field.name %}
<td>Column {{ loop.index }} info</td>
{% endif %}
{% endfor %}
It sounds like the template is being treated as a Django template, not a Jinja template.
Using {{ loop.index }}
should work in a Jinja template, but wouldn't work in a Django template, where you would use {{ forloop.counter }}
instead.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With