{% load l10n djadmin_form djadmin_inline_form %}

{% render bound_field template='fields/django_select.html' %}
    {% attr field 'widget' multiple %}True{% endattr %}
    {% attr field 'group' class append %}multiselect{% endattr %}
    {% part field options %}
        {% if not field|have_default_choice %}<option value="" disabled selected>Choose your option</option>{% endif %}{% for group, items in bound_field|select_options %}{% if group %}<optgroup label="{{ group }}">{% endif %}{% for choice, value, selected in items %}
            <option {% if value == None or value == '' %}disabled{% else %}value="{{ value|unlocalize }}"{% endif %}{% if selected %} selected="selected"{% endif %}>{% if value == None or value == '' %}{{ form_select_empty_label|default:choice }}{% else %}{{ choice }}{% endif %}</option>{% endfor %}
            {% if group %}</optgroup>{% endif %}{% endfor %}
    {% endpart %}
{% endrender %}
