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.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 533248d008d80186cf1db580e89c8904f3caebbec37ab9286ca92f2d0eca3a1b |
|
MD5 | c446aedfd75405ca4ce2d6d392542648 |
|
BLAKE2b-256 | e8e097d6559e02f7968973c5f474ea785cd5c4297c3b8a1c64dbd7ca30290821 |
Close
Hashes for djangorestframework_pagination-1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 557415d8647c862b05744d3623f33173b20774cb4d52635aa3510e544f8c30f9 |
|
MD5 | 94b9c692ac938c5d063c04357b32625e |
|
BLAKE2b-256 | 0392d0dcf1954ef887cbbcdfdac08afc1519f38036cec4580c174cc342e8a173 |