I\'m iterating through the fields of a form and for certain fields I want a slightly different layout, requiring altered HTML.
To do this accurately, I just need to
Following up on the accepted answer - the enhanced if tag in Django 1.2 allows you to use filters in if tag comparisons. So you could now do your custom html/logic in the template like so:
{% for field in form.fields %}
-
{% if field.field.widget|klass == "Textarea" %}
Text Areas are Special
{% else %}
{{ field.errors }}
{{ field.label_tag }}
{{ field }}
{% endif %}
{% endfor %}