{% extends "ddm/admin/base.html" %} {% load i18n admin_urls static admin_modify %} {% block side_nav %} {% include 'ddm/admin/navigation/side_navigation/level_1_questionnaires.html' %} {% include 'ddm/admin/navigation/side_navigation/level_2_questionnaire.html' %} {% include 'ddm/admin/navigation/side_navigation/level_3_page.html' %} {% include 'ddm/admin/navigation/side_navigation/level_4_question.html' %} {% endblock side_nav %} {% block page_title %} {% if question_item %} Update Item-Level Filter  |  Item "{{ question_item.variable_name }}" {% else %} Update Question-Level Filter {% endif %} {% endblock page_title %} {% block page_subtitle %} {{ question.name }} {% endblock page_subtitle %} {% block content %}
{% csrf_token %} {{ formset.management_form }}
Filter Conditions
{% for form in formset.forms %} {% if forloop.first %} {% for field in form.visible_fields %} {% endfor %} {% endif %} {% endfor %} {% for form in formset.forms %} {% for field in form.visible_fields %} {% endfor %} {% for field in form.hidden_fields %} {{ field }} {% endfor %} {% endfor %}
{{ field.label }}
{{ field }}
{% if formset.non_form_errors %} {{ formset.non_form_errors }} {% endif %}
Filter Sequence

Here you can combine the individual filters defined further up and construct the actual filter logic that will be checked by the application.
For this, you first have to decide, if the question/question item should be shown or hidden if the filter sequence evaluates to be true.
To define the actual logic, you can make use of the two logical operators AND() and OR(). The individual filter conditions can be referenced by the filter name.

Example: If we want both filter conditions 'f_1' and 'f_2' to be true in order to show the question/question item, we would first set the logic to 'show if' and define the sequence as follows: 'AND(f_1, f_2)'

{{ form.non_form_errors }} {% for field in filter_sequence_form %} {% include "ddm/admin/forms/form_field.html" %} {% endfor %}
{% endblock %}