{% load crispy_forms_filters %} {% load l10n %}
{% for group, options, index in field|optgroups %} {% if group %}{{ group }}{% endif %} {% for option in options %} {% if field.errors and forloop.last and not inline_class and forloop.parentloop.last %} {% include 'crispy-daisyui/layout/field_errors_block.html' %} {% endif %} {% endfor %} {% endfor %}
{% if field.errors and inline_class %} {% if field.errors.field_id %} {# Django 5.2+ #}