Add New Column
{% csrf_token %} {% for field in form %} {% comment %} field 'insert_position' must be the last field and has some special styling {% endcomment %} {% if field.name == 'insert_position' %} {% comment %} field 'values' are hidden until it is needed {% endcomment %} {% elif field.label == 'values' %} {% elif field.name not in table_fields and field.label not in odd_fields %} {% elif dialect == 'postgresql' and field.label == 'type' %} {% endif %} {% endfor %}
{{field.label_tag}}{{field|safe}}{{field.label_tag}}{{field}} {% elif field.name not in table_fields and field.label in odd_fields %} {{field.label_tag}}{{field}}

{% if dialect == 'mysql' %} {{ form.insert_position}} {% endif %}