{% if widget.attrs.readonly %} {% for group_name, group_choices, group_index in widget.optgroups %} {% for option in group_choices %} {% if option.value|stringformat:'s' in widget.value %} {{option.label}} {% endif %} {% endfor %} {% endfor %} {% else %}
{% endif %}