{# Change compared to Django: only render widget.attrs.class in actual option widget, not in wrapper #} {% with id=widget.attrs.id %}
{% for group, options, index in widget.optgroups %} {% if group %}
{% endif %} {% for option in options %}
{% include option.template_name with widget=option %}
{% endfor %} {% if group %}
{% endif %} {% endfor %}
{% endwith %}