{% load crispy_forms_filters %}
{% load l10n %}

{% for choice in field.field.choices %}
    <div class="form-control">
        <label class="label cursor-pointer">
            <input type="checkbox" class="checkbox"
                {% if choice.0 in field.value or choice.0|stringformat:"s" in field.value or choice.0|stringformat:"s" == field.value|default_if_none:""|stringformat:"s" %} checked="checked"{% endif %}
                name="{{ field.html_name }}"
                id="id_{{ field.html_name }}_{{ forloop.counter }}"
                value="{{ choice.0|unlocalize }}"
                {{ field.field.widget.attrs|flatatt }}>
            <span class="label-text">{{ choice.1|unlocalize }}</span>
        </label>
    </div>
{% endfor %}

{% if field.errors and not inline_class %}
    {% include 'daisyui/layout/field_errors_block.html' %}
{% endif %}