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
File details
Details for the file marshmallow_pageinfo-1.0.0.tar.gz
.
File metadata
- Download URL: marshmallow_pageinfo-1.0.0.tar.gz
- Upload date:
- Size: 1.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
1776d265eb7ed8bb987c0031a1ecf57981d9ce6c133309152ab0e897180908c3
|
|
MD5 |
07bcd15dd6fc29a44e86b70871650c46
|
|
BLAKE2b-256 |
265eef99e98ee139154074525ad7ed23e1e8ce502267fbd54fdd82e3b9596330
|
File details
Details for the file marshmallow_pageinfo-1.0.0-py3-none-any.whl
.
File metadata
- Download URL: marshmallow_pageinfo-1.0.0-py3-none-any.whl
- Upload date:
- Size: 2.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
6b5a05a56b56b2e7e7fdd5e15b3427cc2926c5d2a525085f68ab8f913ce689ea
|
|
MD5 |
00ad96293b7993f612df0cec2f6995ad
|
|
BLAKE2b-256 |
408886eb232eeac7a48c276e9283c3b0c702e5a06d2af379d7d1d87e8509e04c
|