File tree 3 files changed +21
-6
lines changed
3 files changed +21
-6
lines changed Original file line number Diff line number Diff line change 1
1
from rest_framework .pagination import PageNumberPagination
2
2
3
3
class ResultSetPagination (PageNumberPagination ):
4
- page_size = 30
4
+ page_size = 20
5
5
page_size_query_param = 'page_size'
6
- max_page_size = 50
6
+ max_page_size = 20
7
+
8
+ def get_paginated_response (self , data ):
9
+ response = super (ResultSetPagination , self ).get_paginated_response (data )
10
+ response .data ['total_pages' ] = self .page .paginator .num_pages
11
+ return response
Original file line number Diff line number Diff line change 1
1
from rest_framework .pagination import PageNumberPagination
2
2
3
3
class ResultSetPagination (PageNumberPagination ):
4
- page_size = 30
4
+ page_size = 20
5
5
page_size_query_param = 'page_size'
6
- max_page_size = 50
6
+ max_page_size = 20
7
+
8
+ def get_paginated_response (self , data ):
9
+ response = super (ResultSetPagination , self ).get_paginated_response (data )
10
+ response .data ['total_pages' ] = self .page .paginator .num_pages
11
+ return response
Original file line number Diff line number Diff line change 1
1
from rest_framework .pagination import PageNumberPagination
2
2
3
3
class ResultSetPagination (PageNumberPagination ):
4
- page_size = 30
4
+ page_size = 20
5
5
page_size_query_param = 'page_size'
6
- max_page_size = 50
6
+ max_page_size = 20
7
+
8
+ def get_paginated_response (self , data ):
9
+ response = super (ResultSetPagination , self ).get_paginated_response (data )
10
+ response .data ['total_pages' ] = self .page .paginator .num_pages
11
+ return response
You can’t perform that action at this time.
0 commit comments