{% for optgroup, choice_tuples in field.grouped_choice_tuples %} {% if optgroup %} {% endif %} {% for choice in choice_tuples %} {% endfor %} {% if optgroup %} {% endif %} {% endfor %}