Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
Yakser committed Nov 21, 2022
2 parents f016261 + fbbb113 commit bafa863
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions vacancy/filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ class VacancyFilter(filters.FilterSet):
Adds filtering to DRF list retrieve views
Parameters to filter by:
project (int), is_active (default to True if not set otherwise) (boolean)
project_id (int), is_active (default to True if not set otherwise) (boolean)
Examples:
?project=1 equals to .filter(project_id=1)
?project_id=1 equals to .filter(project_id=1)
(no params passed) equals to .filter(is_active=True)
?is_active=false equals to .filter(is_active=False)
"""
Expand All @@ -33,8 +33,8 @@ def __init__(self, *args, **kwargs):
self.data["is_active"] = True

is_active = filters.BooleanFilter(field_name="is_active")
project = filters.Filter(method=project_id_filter)
project_id = filters.Filter(method=project_id_filter)

class Meta:
model = Vacancy
fields = ("project", "is_active")
fields = ("project_id", "is_active")

0 comments on commit bafa863

Please sign in to comment.