add new buttons in account
This commit is contained in:
@@ -10,6 +10,7 @@ from django.utils import timezone
|
||||
from django.db.models import Q
|
||||
from urllib.parse import unquote
|
||||
from api.utils.cityVariator import get_city_variations
|
||||
from django.db.models.functions import Coalesce
|
||||
|
||||
class SearchRouteListView(generics.ListAPIView):
|
||||
serializer_class = SearchRouteSerializer
|
||||
@@ -93,5 +94,9 @@ class SearchRouteListView(generics.ListAPIView):
|
||||
else: # customer
|
||||
queryset = queryset.filter(arrival_DT__gt=current_time)
|
||||
|
||||
# print(queryset)
|
||||
return queryset.order_by('-arrival_DT')
|
||||
# премиум мембершип -- добавляем аннотацию и сортируем по последнему поднятию или дате создания
|
||||
queryset = queryset.annotate(
|
||||
sort_time=Coalesce('rising_DT', 'created_at')
|
||||
).order_by('-sort_time')
|
||||
|
||||
return queryset
|
||||
|
||||
Reference in New Issue
Block a user