{% load form_helpers %} {% load helpers %}
{% for field in filter_form.hidden_fields %} {{ field }} {% endfor %} {# List filters by group #} {% for heading, fields in filter_form.fieldsets %}
{% if heading %}
{{ heading }}
{% endif %} {% for name in fields %} {% with field=filter_form|get_item:name %} {% render_field field %} {% endwith %} {% endfor %}
{% if not forloop.last %}
{% endif %} {% empty %} {# List all non-customfield filters as declared in the form class #} {% for field in filter_form.visible_fields %} {% if not filter_form.custom_fields or field.name not in filter_form.custom_fields %}
{% render_field field %}
{% endif %} {% endfor %} {% endfor %} {% if filter_form.custom_fields %} {# List all custom field filters #}
{% for name in filter_form.custom_fields %}
{% with field=filter_form|get_item:name %} {% render_field field %} {% endwith %}
{% endfor %} {% endif %}