Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save cadu-leite/fa4899f213463429b699e07d158c4885 to your computer and use it in GitHub Desktop.
Save cadu-leite/fa4899f213463429b699e07d158c4885 to your computer and use it in GitHub Desktop.
'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