Skip to content

Commit 34ac1a9

Browse files
committed
Добавлен булевый фильтр для пользователя, явяляется ли он студентом московского Политеха
1 parent c49c9a3 commit 34ac1a9

2 files changed

Lines changed: 6 additions & 0 deletions

File tree

users/filters.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,11 @@ def filter_by_fullname(cls, queryset, name, value):
113113

114114
skills__contains = filters.Filter(method="filter_by_skills")
115115

116+
is_mospolytech_student = filters.BooleanFilter(
117+
field_name="is_mospolytech_student",
118+
label="Студент Московского Политеха",
119+
)
120+
116121
class Meta:
117122
model = User
118123
fields = (

users/serializers.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -792,6 +792,7 @@ class Meta:
792792
"is_online",
793793
"birthday",
794794
"speciality",
795+
"is_mospolytech_student",
795796
]
796797

797798

0 commit comments

Comments
 (0)