File tree Expand file tree Collapse file tree 1 file changed +12
-14
lines changed
Expand file tree Collapse file tree 1 file changed +12
-14
lines changed Original file line number Diff line number Diff 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
213225link 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
230228License
231229------ -
You can’t perform that action at this time.
0 commit comments