I am adding a ‘for’ loop in tags in the template that iterates over a list of model objects. I would like it to have an ‘if’ statement asking if the object instance is the first in the list. How do I write this statement exactly? Something like this?
{% for model in model_list %}
{% if model.index() == 0 %}
{% endif %}
{% endfor %}
Hi @CodenameTim, Thanks for your reply! I can see there in that link the correct syntax for the ‘if’ statement. I still don’t see the how to access the model object index. Would it be something like this?