Created
April 15, 2019 14:46
-
-
Save cadu-leite/fa4899f213463429b699e07d158c4885 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'DEFAULT_PAGINATION_CLASS': 'rest_framework.pagination.LimitOffsetPagination', | |
URL: http://localhost:8080/api/v1/project/?limit=2&offset=2 | |
Result | |
----- | |
>> 7 reg total | |
``` | |
{ | |
"count": 7, | |
"next": "http://localhost:8080/api/v1/project/?limit=2&offset=4", | |
"previous": "http://localhost:8080/api/v1/project/?limit=2", | |
"results": [ | |
{ | |
"id": 3, | |
}, | |
{ | |
"id": 4, | |
} | |
] | |
} | |
``` | |
'DEFAULT_PAGINATION_CLASS': 'rest_framework.pagination.PageNumberPagination', | |
'PAGE_SIZE': 5, | |
Will limit 5 per page by default ... | |
to change page size ... | |
Mus define a CLass to define the `page_size_query_param`parameter. | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment