{% for item in form.hidden_control_items_to_true.all %} {% if item.active == 1 %} {% if item.type == 0 %} {% endif %} {% endif %} {% endfor %} {% for item in form.control_items.all %} {% if item.active == 1 and item.pk in visible_control_element_list %} {% if item.type == 0 %} {% include "control_element.html" with form=form %} {% endif %} {% endif %} {% endfor %}