I have a Django form that contains several fields I am looping through. I want to branch the code if the field is the “comment” field, something like this:
{% for field in form.visible_fields %}
{% if field == form.fields.comment %}
<do something>
{% else %}
<do something else>
{% endif %}
{% endfor %}
What is the correct syntax for the 2nd line? The current line always fails.
I believe it would be: