{% macro render_field(field, disabled_fields=[], exclude_fields=[]) %} {% set disabled = field.name in disabled_fields %} {% set exclude_fields = exclude_fields + ['csrf_token', 'submit'] %} {% if field.name not in exclude_fields %} {% if field.type == 'BooleanField' %}
{{ field(class="form-check-input", type="checkbox", id="flexSwitchCheckDefault") }} {{ field.label(class="form-check-label", for="flexSwitchCheckDefault", disabled=disabled) }}
{% else %}
{{ field.label(class="form-label") }} {{ field(class="form-control", disabled=disabled) }} {% if field.errors %}
{% for error in field.errors %} {{ error }} {% endfor %}
{% endif %}
{% endif %} {% endif %} {% endmacro %}