{% if headings %} {% for h in headings %}{% endfor %} {% else %} {% for f in fields %}{% endfor %} {% endif %} {% for o in object_list %} {% for f in fields %} {% endfor %} {% endfor %}
{{ h }}{{ f }}
{{ o|getattr:f }}