fairdm.api.pagination#

FairDM API pagination classes.

Module Contents#

Classes#

FairDMPagination

Standard pagination for FairDM API endpoints.

API#

class FairDMPagination[source]#

Bases: rest_framework.pagination.PageNumberPagination

Standard pagination for FairDM API endpoints.

The default page size is REST_FRAMEWORK["PAGE_SIZE"] and the largest a caller may ask for is FAIRDM_API_MAX_PAGE_SIZE. Both are read when a request is answered, so a change to either setting changes the API.

Response format::

{
    "count": 100,
    "next": "http://example.com/api/v1/projects/?page=2",
    "previous": null,
    "results": [...],
}

Query parameters: - page: page number (1-based) - page_size: number of results per page, up to the largest page size

page_size_query_param#

‘page_size’

property page_size: int | None#

The number of records in a page when the caller does not ask for another.

property max_page_size: int | None#

The most records a caller may ask for in one page.