{% with id=widget.attrs.id %}
{% for group, options, index in widget.optgroups %} {% if group %}
{% endif %} {% for option in options %}
{% if option.wrap_label %} {% endif %}
{% endfor %} {% if group %}
{% endif %} {% endfor %}
{% endwith %}