7.1.1.1.2.4. claimstore.core.pagination module

Restful pagination.

class claimstore.core.pagination.RestfulSQLAlchemyPaginationMixIn

Bases: object

Implement Restful pagination for SQLAlchemy model and Flask-Restful.

It creates an instance of RequestParser that should be used by the Restful Resource implementation. By default, it adds two query fields to the Restful Resource:

Parameters:
  • page – page from which to fetch the data
  • per_page – amout of data per page

Paginate query.

Parameters:
  • query – query object from SQLAlchemy.
  • page – page from which to fetch data.
  • per_page – amount of data per page.

Set Link details in the response header.

Parameters:response – Flask Response object.