You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: docs/ref/filters.txt
+11-10
Original file line number
Diff line number
Diff line change
@@ -274,7 +274,7 @@ Matches on a date and time. Used with ``DateTimeField`` by default.
274
274
275
275
Uses ``IsoDateTimeField`` to support filtering on ISO 8601 formatted dates, as are often used in APIs, and are employed by default by Django REST Framework.
276
276
277
-
Example. ::
277
+
Example::
278
278
279
279
class F(FilterSet):
280
280
"""Filter for Books by date published, using ISO 8601 formatted dates"""
@@ -301,10 +301,11 @@ and week designators, e.g. 'P3DT10H22M').
301
301
Similar to a ``ChoiceFilter`` except it works with related models, used for
302
302
``ForeignKey`` by default.
303
303
304
-
If automatically instantiated ``ModelChoiceFilter`` will use the default ``QuerySet`` for the
305
-
related field. If manually instantiated you **must** provide the ``queryset`` kwarg.
304
+
If automatically instantiated, ``ModelChoiceFilter`` will use the default
305
+
``QuerySet`` for the related field. If manually instantiated you **must**
306
+
provide the ``queryset`` kwarg.
306
307
307
-
Example. ::
308
+
Example::
308
309
309
310
class F(FilterSet):
310
311
"""Filter for books by author"""
@@ -320,9 +321,9 @@ Example. ::
320
321
Similar to a ``MultipleChoiceFilter`` except it works with related models, used
321
322
for ``ManyToManyField`` by default.
322
323
323
-
As with ``ModelChoiceFilter``, if automatically instantiated ``ModelMultipleChoiceFilter`` will use
324
-
the default ``QuerySet`` for the related field. If manually instantiated you **must** provide the
325
-
``queryset`` kwarg.
324
+
As with ``ModelChoiceFilter``, if automatically instantiated,
325
+
``ModelMultipleChoiceFilter`` will use the default ``QuerySet`` for the related
326
+
field. If manually instantiated you **must** provide the ``queryset`` kwarg.
326
327
327
328
``NumberFilter``
328
329
~~~~~~~~~~~~~~~~
@@ -516,7 +517,7 @@ this filter class is used in conjunction with another filter class, as this
516
517
class **only** validates that the incoming value is comma-separated. The secondary
517
518
filter is then used to validate the individual values.
518
519
519
-
Example. ::
520
+
Example::
520
521
521
522
class NumberInFilter(BaseInFilter, NumericFilter):
522
523
pass
@@ -543,7 +544,7 @@ This is a base class used for creating RANGE lookup filters. It behaves
543
544
identically to ``BaseInFilter`` with the exception that it expects only two
544
545
comma-separated values.
545
546
546
-
Example. ::
547
+
Example::
547
548
548
549
class NumberRangeFilter(BaseInFilter, NumericFilter):
549
550
pass
@@ -571,7 +572,7 @@ This is a ``Filter`` that will allow you to run a method that exists on the filt
571
572
this filter is a property of. Set the `action` to a string that will map to a method on the
572
573
filter set class. `action` will default to ``filter_{value-of-name-attribute}``
573
574
574
-
Example. ::
575
+
Example::
575
576
576
577
class F(FilterSet):
577
578
"""Filter for Books by if books are published or not"""
0 commit comments