当前位置:
首页 > Python基础教程 >
-
Django多条件筛选查询(2)
class="input-group mb-12">
{% with filter_event_form.user as filter_fields %}
<div class="input-group-prepend">
<label class="input-group-text {% if filter_fields.errors %}bg-danger {% endif %}" for="{{ filter_fields.id_for_label }}">{{ filter_fields.label }}</label>
</div>
<select class="form-control col-sm-12" name="user" id="{{ filter_fields.id_for_label }}">
<option>{% for select in filter_fields %}{{ select }}{% endfor %}</option>
</select>
{% endwith %}
</div>
</div>
<div class="col-2">
<div class="input-group mb-12">
{% with filter_event_form.status as filter_fields %}
<div class="input-group-prepend">
<label class="input-group-text {% if filter_fields.errors %}bg-danger{% endif %}" for="{{ filter_fields.id_for_label }}">{{ filter_fields.label }}</label>
</div>
<select class="form-control col-sm-12" name="status" id="{{ filter_fields.id_for_label }}">
<option>{% for select in filter_fields %}{{ select }}{% endfor %}</option>
</select>
{% endwith %}
</div>
</div>
<div class="col-2">
<div class="input-group mb-12">
{% with filter_event_form.project as filter_fields %}
<div class="input-group-prepend">
<label class="input-group-text {% if filter_fields.errors %}bg-danger {% endif %}" for="{{ filter_fields.id_for_label }}">{{ filter_fields.label }}</label>
</div>
<select class="form-control col-sm-12" name="project" id="{{ filter_fields.id_for_label }}">
<option>{% for select in filter_fields %}{{ select }}{% endfor %}</option>
</select>
{% endwith %}
</div>
</