We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
PersonFilter
filtering.rst
1 parent 4826a48 commit b8925e4Copy full SHA for b8925e4
docs/pages/filtering.rst
@@ -21,6 +21,15 @@ The basis of a filtered table is a `SingleTableMixin` combined with a
21
22
filterset_class = PersonFilter
23
24
+The ``PersonFilter`` is defined the following way::
25
+
26
+ from django_filters import FilterSet
27
+ from .models import Person
28
29
+ class PersonFilter(FilterSet):
30
+ class Meta:
31
+ model = Person
32
+ fields = {"name": ["exact", "contains"], "country": ["exact"]}
33
34
The ``FilterSet`` is added to the template context in a ``filter`` variable by
35
default. A basic template rendering the filter (using django-bootstrap3)[https://pypi.org/project/django-bootstrap3/] and
0 commit comments