diff --git a/docs/filtering.rst b/docs/filtering.rst index 6c84b8b08..a131b30a1 100644 --- a/docs/filtering.rst +++ b/docs/filtering.rst @@ -2,9 +2,9 @@ Filtering ========= Graphene-Django integrates with -`django-filter `__ (2.x for +`django-filter `__ (2.x for Python 3 or 1.x for Python 2) to provide filtering of results. See the `usage -documentation `__ +documentation `__ for details on the format for ``filter_fields``. This filtering is automatically available when implementing a ``relay.Node``. @@ -27,7 +27,7 @@ After installing ``django-filter`` you'll need to add the application in the ``s ] Note: The techniques below are demoed in the `cookbook example -app `__. +app `__. Filterable fields ----------------- @@ -35,7 +35,7 @@ Filterable fields The ``filter_fields`` parameter is used to specify the fields which can be filtered upon. The value specified here is passed directly to ``django-filter``, so see the `filtering -documentation `__ +documentation `__ for full details on the range of options available. For example: @@ -163,7 +163,7 @@ in unison with the ``filter_fields`` parameter: animal = relay.Node.Field(AnimalNode) all_animals = DjangoFilterConnectionField(AnimalNode) -The context argument is passed on as the `request argument `__ +The context argument is passed on as the `request argument `__ in a ``django_filters.FilterSet`` instance. You can use this to customize your filters to be context-dependent. We could modify the ``AnimalFilter`` above to pre-filter animals owned by the authenticated user (set in ``context.user``).