{{ errors }} {% if errors and not fields %}
{% for field in hidden_fields %}{{ field }}{% endfor %}
{% endif %} {% for field, errors in fields %} {# support django < 5 by checking if as_field_group exists #} {% if field.as_field_group %} {{ field.as_field_group }} {% else %} {% include 'django_extensible_forms/forms/field.html' %} {% endif %} {% if forloop.last %} {% for field in hidden_fields %}{{ field }}{% endfor %} {% endif %} {% endfor %} {% if not fields and not errors %} {% for field in hidden_fields %}{{ field }}{% endfor %} {% endif %}