File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ from rest_framework import pagination
2+
3+
4+ class UsersPagination (pagination .LimitOffsetPagination ):
5+ """
6+ Pagination for Users
7+
8+ For example:
9+ /news/?limit=10&offset=10
10+ gets the next 10 news after the first 10 news.
11+ """
12+
13+ default_limit = 10
14+ limit_query_param = "limit"
15+ offset_query_param = "offset"
Original file line number Diff line number Diff line change 5656 ResendVerifyEmailSerializer ,
5757)
5858from .filters import UserFilter
59+ from .pagination import UsersPagination
5960from .services .verification import VerificationTasks
6061
6162User = get_user_model ()
@@ -66,6 +67,7 @@ class UserList(ListCreateAPIView):
6667 queryset = User .objects .get_active ()
6768 permission_classes = [AllowAny ] # FIXME: change to IsAuthorized
6869 serializer_class = UserListSerializer
70+ pagination_class = UsersPagination
6971 filter_backends = (filters .DjangoFilterBackend ,)
7072 filterset_class = UserFilter
7173
You can’t perform that action at this time.
0 commit comments