From 783b5922286a3bd77b365955f060cccc5f527552 Mon Sep 17 00:00:00 2001 From: Jonas Vacek Date: Wed, 29 Nov 2023 19:15:04 +0100 Subject: [PATCH] Add filterset_fields lookup expresson to docs (#1460) --- docs/guide/tips.txt | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/docs/guide/tips.txt b/docs/guide/tips.txt index 5b514ad3..2067b2c0 100644 --- a/docs/guide/tips.txt +++ b/docs/guide/tips.txt @@ -37,6 +37,16 @@ would be: class ProductFilter(django_filters.FilterSet): price__gt = django_filters.NumberFilter(field_name='price', lookup_expr='gt') + +When using ``filterset_fields``, you can also add the ``lookup_expr`` in the +dict of fields like so: + +.. code-block:: python + # ... ModelViewSet with DjangoFilterBackend in filter_backends ... + + filterset_fields = { + "price": ["gt", "exact"], + } Missing ``lookup_expr`` for text search filters