Skip to content

Commit 3e8ffcd

Browse files
committed
Fixes #48 by tweaking documentation.
Ugh, so sorry to have missed this. May other people benefit from my mistake.
1 parent 5ef0bf6 commit 3e8ffcd

File tree

1 file changed

+12
-14
lines changed

1 file changed

+12
-14
lines changed

README.rst

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,18 @@ then we can automatically chain our filters through the ``author`` relation, as
9090

9191
/api/page/?author__username=philipn
9292

93+
Recursive relations are also supported. You will need to specify the full module
94+
path in the ``RelatedFilter`` definition in some cases, e.g.:
95+
96+
.. code-block:: python
97+
98+
class PersonFilter(filters.FilterSet):
99+
name = filters.AllLookupsFilter(name='name')
100+
best_friend = filters.RelatedFilter('people.views.PersonFilter', name='best_friend')
101+
102+
class Meta:
103+
model = Person
104+
93105
94106
Allowing any lookup type on a field
95107
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -212,20 +224,6 @@ Yes you can. `django-rest-framework-filters` extends `django-filter`, and you c
212224
``django-rest-framework-filters``, but you can use ``RelatedFilter`` to
213225
link to a filter relation defined elsewhere that uses vanilla ``django-filter``.
214226
215-
More information on RelatedFilter
216-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
217-
218-
Recursive relations are supported. You will need to specify the full module
219-
path in the ``RelatedFilter`` definition in some cases, e.g.:
220-
221-
.. code-block:: python
222-
223-
class PersonFilter(filters.FilterSet):
224-
name = filters.AllLookupsFilter(name='name')
225-
best_friend = filters.RelatedFilter('people.views.PersonFilter', name='best_friend')
226-
227-
class Meta:
228-
model = Person
229227
230228
License
231229
-------

0 commit comments

Comments
 (0)