{% load form_helpers %} {% load helpers %}
{# Render the field label (if any), except for checkboxes #} {% if label and not field|widget_type == 'checkboxinput' %} {% endif %} {# Render the field itself #}
{# Include the "regenerate" button on slug fields #} {% if field|widget_type == 'slugwidget' %}
{{ field }}
{# Render checkbox labels to the right of the field #} {% elif field|widget_type == 'checkboxinput' %}
{{ field }}
{# Default field rendering #} {% else %} {{ field }} {% endif %} {# Display any error messages #} {% if field.errors %}
{% for error in field.errors %}{{ error }}{% if not forloop.last %}
{% endif %}{% endfor %}
{% elif field.field.required %}
This field is required.
{% endif %} {# Help text #} {% if field.help_text %} {{ field.help_text|safe }} {% endif %} {# For bulk edit forms, include an option to nullify the field #} {% if bulk_nullable %}
{% endif %}