forked from HumanSignal/label-studio
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: DEV-2575: Add filter by ids for project list (HumanSignal#2565)
* feat: DEV-2575: Add filter by ids for project list * Add test (DEV-2575)
- Loading branch information
1 parent
27eb3e2
commit 0d76e69
Showing
3 changed files
with
85 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
from django_filters import Filter | ||
from django_filters.constants import EMPTY_VALUES | ||
|
||
class ListFilter(Filter): | ||
def filter(self, qs, value): | ||
if value in EMPTY_VALUES: | ||
return qs | ||
value_list = value.split(",") | ||
qs = super().filter(qs, value_list) | ||
return qs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters