File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed
Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -164,6 +164,20 @@ then we can filter like so::
164164
165165 /api/page/?author__username__icontains=john
166166
167+ Automatic Filter Negation/Exclusion
168+ ~~~~~~~~~~~~~~~~~~~~~~~~~
169+
170+ FilterSets also support automatic exclusion using a simple ``k!=v `` syntax. This syntax
171+ internally sets the ``exclude `` property on the filter.
172+
173+ /api/page/?title!=The%20Park
174+
175+ This syntax supports regular filtering combined with exclusion filtering. For example,
176+ the following would search for all articles containing "Hello" in the title, while
177+ excluding those containing "World".
178+
179+ /api/articles/?title__contains=Hello&title__contains!=World
180+
167181DjangoFilterBackend
168182~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
169183
You can’t perform that action at this time.
0 commit comments