Page info marshmallow schema for api
Project description
marshmallow_pageinfo
Page info marshmallow schema for api
Installation
pip install -U marshmallow_pageinfo
Example
from marshmallow_pageinfo import PAGE_INFO_SCHEMA
@controller.route('/', methods=['GET'])
def get_todo():
page_info = PAGE_INFO_SCHEMA.load(request.args)
pagination = todo_q.paginate(page_info['page'], page_info['per_page'])
return {
'todos': TODO_SCHEMA.dump(pagination.items),
'pageInfo': PAGE_INFO_SCHEMA.dump(pagination),
}
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 marshmallow_pageinfo-1.0.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1776d265eb7ed8bb987c0031a1ecf57981d9ce6c133309152ab0e897180908c3 |
|
MD5 | 07bcd15dd6fc29a44e86b70871650c46 |
|
BLAKE2b-256 | 265eef99e98ee139154074525ad7ed23e1e8ce502267fbd54fdd82e3b9596330 |
Close
Hashes for marshmallow_pageinfo-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6b5a05a56b56b2e7e7fdd5e15b3427cc2926c5d2a525085f68ab8f913ce689ea |
|
MD5 | 00ad96293b7993f612df0cec2f6995ad |
|
BLAKE2b-256 | 408886eb232eeac7a48c276e9283c3b0c702e5a06d2af379d7d1d87e8509e04c |