Skip to content

Commit

Permalink
Merge branch 'dev' into LTD-fix-sorting
Browse files Browse the repository at this point in the history
  • Loading branch information
saruniitr authored Dec 12, 2024
2 parents 1cf6694 + b2fb41c commit f9d6ff0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 4 additions & 0 deletions api/conf/pagination.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,7 @@ class MaxFiftyPageSizePaginator(MaxPageNumberPagination):
page_size = 50
page_size_query_param = "page_size"
max_page_size = 50


class CreatedAtCursorPagination(pagination.CursorPagination):
ordering = "-created_at"
3 changes: 2 additions & 1 deletion api/data_workspace/v1/good_views.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
from rest_framework import viewsets
from rest_framework.pagination import LimitOffsetPagination

from api.conf.pagination import CreatedAtCursorPagination
from api.goods import models, serializers
from api.core.authentication import DataWorkspaceOnlyAuthentication


class GoodListView(viewsets.ReadOnlyModelViewSet):
authentication_classes = (DataWorkspaceOnlyAuthentication,)
serializer_class = serializers.GoodSerializerInternalIncludingPrecedents
pagination_class = LimitOffsetPagination
pagination_class = CreatedAtCursorPagination
queryset = models.Good.objects.all()


Expand Down

0 comments on commit f9d6ff0

Please sign in to comment.