-
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.
Merge pull request #78 from maykinmedia/feature/65-filter-destruction…
…-list [#65] Filter destruction list on assignee
- Loading branch information
Showing
3 changed files
with
41 additions
and
3 deletions.
There are no files selected for viewing
15 changes: 13 additions & 2 deletions
15
backend/src/openarchiefbeheer/destruction/api/filtersets.py
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 |
---|---|---|
@@ -1,9 +1,20 @@ | ||
from django_filters import FilterSet | ||
from django_filters import FilterSet, NumberFilter | ||
|
||
from ..models import DestructionListItem | ||
from ..models import DestructionList, DestructionListItem | ||
|
||
|
||
class DestructionListItemFilterset(FilterSet): | ||
class Meta: | ||
model = DestructionListItem | ||
fields = ("destruction_list",) | ||
|
||
|
||
class DestructionListFilterset(FilterSet): | ||
assignee = NumberFilter( | ||
field_name="assignee", | ||
help_text="The pk of the user currently assigned to the list.", | ||
) | ||
|
||
class Meta: | ||
model = DestructionList | ||
fields = ("assignee",) |
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