add status functionality
This commit is contained in:
@@ -37,7 +37,7 @@ class NewsView(APIView):
|
||||
class LatestRoutesView(APIView):
|
||||
@handle_exceptions
|
||||
def get(self, request):
|
||||
"""Получаем последние маршруты"""
|
||||
"""Получаем последние актуальные маршруты"""
|
||||
|
||||
routes = []
|
||||
owner_types = dict(owner_type_choices).keys()
|
||||
@@ -45,7 +45,10 @@ class LatestRoutesView(APIView):
|
||||
for owner_type in owner_types:
|
||||
routes.extend(
|
||||
HomePageRouteSerializer(
|
||||
Route.objects.filter(owner_type=owner_type).order_by('-id')[:5],
|
||||
Route.objects.filter(
|
||||
owner_type=owner_type,
|
||||
status="actual"
|
||||
).order_by('-id')[:5],
|
||||
many=True
|
||||
).data
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user