@@ -2,9 +2,9 @@ Filtering
2
2
=========
3
3
4
4
Graphene-Django integrates with
5
- `django-filter <https://django-filter.readthedocs.io/en/master / >`__ (2.x for
5
+ `django-filter <https://django-filter.readthedocs.io/en/main / >`__ (2.x for
6
6
Python 3 or 1.x for Python 2) to provide filtering of results. See the `usage
7
- documentation <https://django-filter.readthedocs.io/en/master /guide/usage.html#the-filter> `__
7
+ documentation <https://django-filter.readthedocs.io/en/main /guide/usage.html#the-filter> `__
8
8
for details on the format for ``filter_fields ``.
9
9
10
10
This filtering is automatically available when implementing a ``relay.Node ``.
@@ -27,15 +27,15 @@ After installing ``django-filter`` you'll need to add the application in the ``s
27
27
]
28
28
29
29
Note: The techniques below are demoed in the `cookbook example
30
- app <https://github.com/graphql-python/graphene-django/tree/master /examples/cookbook> `__.
30
+ app <https://github.com/graphql-python/graphene-django/tree/v2 /examples/cookbook> `__.
31
31
32
32
Filterable fields
33
33
-----------------
34
34
35
35
The ``filter_fields `` parameter is used to specify the fields which can
36
36
be filtered upon. The value specified here is passed directly to
37
37
``django-filter ``, so see the `filtering
38
- documentation <https://django-filter.readthedocs.io/en/master /guide/usage.html#the-filter> `__
38
+ documentation <https://django-filter.readthedocs.io/en/main /guide/usage.html#the-filter> `__
39
39
for full details on the range of options available.
40
40
41
41
For example:
@@ -163,7 +163,7 @@ in unison with the ``filter_fields`` parameter:
163
163
animal = relay.Node.Field(AnimalNode)
164
164
all_animals = DjangoFilterConnectionField(AnimalNode)
165
165
166
- The context argument is passed on as the `request argument <http://django-filter.readthedocs.io/en/master /guide/usage.html#request-based-filtering >`__
166
+ The context argument is passed on as the `request argument <http://django-filter.readthedocs.io/en/main /guide/usage.html#request-based-filtering >`__
167
167
in a ``django_filters.FilterSet `` instance. You can use this to customize your
168
168
filters to be context-dependent. We could modify the ``AnimalFilter `` above to
169
169
pre-filter animals owned by the authenticated user (set in ``context.user ``).
0 commit comments