response pagination using django restframework
Project description
example:
class TestAPI(APIView):
@staticmethod
def get(request):
tests = Test.objects.all() # filter or order by or anything else
pagination = PaginationObject(objects=tests, page=1, numbers_in_page=10,
serializer=TestSerializer)
return Response(pagination.serializer_data(), status=status.HTTP_200_OK)
to get all objects in one page :
pagination = PaginationObject(objects=tests, page=1, numbers_in_page=-1,
serializer=TestSerializer)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for djangorestframework_pagination-1.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | a0948c8e018329031770c1e2696fb0dbf4457d3a47e4c3d94ef55ab0afdb5b9e |
|
MD5 | ec9670aceb07967e3cdd3c604c4f3ba9 |
|
BLAKE2b-256 | afc8a84acf62632ea99105bdb23ebeaddb2e9fe4a591c0b390824ac337c4e0ba |
Close
Hashes for djangorestframework_pagination-1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e846d2ec5a9f51bc25c4b1ff4610e385eaa7e99c61a04952f7f4b36559daa5f6 |
|
MD5 | 509e9c766618e49e9811538aa75a2d61 |
|
BLAKE2b-256 | d06b92aecb34971357fd0ef996b40560468186409f3dd74cb8ef42686329cfc4 |