{# templates/widgets/tree_widget.html #} {% load widget_tweaks %} {% if widget.optgroups %} {% for group, options, index in widget.optgroups %} {% if group %} {% endif %} {% for option in options %} {{ option.label }} {% endfor %} {% if group %} {% endif %} {% endfor %} {% endif %}