Skip to main content

Django Rest Framework Multiple Queryset Pagination

This is django rest framework pagination based on LimitOffsetPagination with multiple queryset support

Installation

Install the package with pip:

$ pip install rest_framework_pagination

Usage

from rest_framework.viewsets import GenericViewSet
from rest_framework.mixins import ListModelMixin
from rest_framework_pagination.pagination import MultiQuerysetPagination


class MainPageView(ListModelMixin, GenericViewSet):
    serializer_class = serializers.MainPageSerializer
    pagination_class = MultiQuerysetPagination
    querysets = [models.Person.objects.all(),
                 models.Order.objects.all(),
                 models.Address.objects.all()]

    def get_queryset(self):
        return self.querysets

    def paginate_querysets(self, querysets):
        return self.paginator.paginate(querysets, self.request, view=self)

    def list(self, request, *args, **kwargs):
        page = self.paginate_querysets(self.get_queryset())
        serializer = self.get_serializer_class()(page, many=True)
        return self.get_paginated_response(serializer.data)

Metadata

Release files for rest-framework-pagination 0.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for rest-framework-pagination 0.0.1
File Size Uploaded Provenance Actions
rest_framework_pagination-0.0.1.tar.gz 2.1 kB Without provenance Details for rest_framework_pagination-0.0.1.tar.gz

Release files / rest_framework_pagination-0.0.1.tar.gz

Download URL rest_framework_pagination-0.0.1.tar.gz
Size 2.1 kB
Tags Source
SHA-256 checksum
How to use checksums
ee76bb12d12936a369a51cab2901eec87890d4d15b0dc0fd910737884e9c1198
BLAKE2b-256 checksum
How to use checksums
73553224b177dce52dcff62dd5136ca6ccc24870b54500c8aea306da17b6069a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.55.1 CPython/3.7.6rc1

Security for rest-framework-pagination 0.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.0.1 This release

1 release file No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page