{% spaceless %} {% with id=widget.attrs.id %} {% for group, options, index in widget.optgroups %}{% if group %}