{% for group, options, index in widget.optgroups %} {% if group %} {{ group }} {% endif %} {% for option in options %}