我创建了 django-filter 以便在 django-table2 上执行列过滤,但我仍然无法设置生成的下拉列表的样式以匹配整体页面样式
-我正在使用 Bootsrap3
请发布任何解决此问题的建议,或者我应该使用常规 django 表单进行列过滤
这是我的过滤器类表单 filter.py
Pi_FILTER_CHOICES= (('', 'Select PI#'),(1,"PI1"),(2,"PI2"),(3,"PI3"),)
class PI_NameFilter(filters.FilterSet):
pi_name = filters.ChoiceFilter( label = "PI Name", choices=Pi_FILTER_CHOICES)
class Meta:
modle = SamplesLinkage
Run Code Online (Sandbox Code Playgroud)
这是我模板上的过滤器
{% block filter %}
<form action="" method="get">
<label for="id_pi_name">Search by PI: </label>
{{ filter.form.pi_name }}
<button type="submit" class="btn btn-default btn-sm">
<span class="glyphicon glyphicon-search" aria-hidden="true"></span> Go Find
</button>
</form>
{% endblock %}
Run Code Online (Sandbox Code Playgroud)