add status functionality
This commit is contained in:
@@ -18,8 +18,10 @@ class SearchRouteListView(generics.ListAPIView):
|
||||
if not owner_type or owner_type not in valid_types:
|
||||
raise ValidationError("Invalid or missing owner_type. Must be either 'customer' or 'mover'")
|
||||
|
||||
# базовый фильтр по типу владельца
|
||||
queryset = Route.objects.filter(owner_type=owner_type)
|
||||
# базовый фильтр по типу владельца и актуальности
|
||||
queryset = Route.objects.filter(
|
||||
owner_type=owner_type,
|
||||
status="actual")
|
||||
|
||||
# фильтруем по времени в зависимости от типа
|
||||
if owner_type == 'mover':
|
||||
|
||||
Reference in New Issue
Block a user