can't return json pagination in flask for REST API
See the API docs.
If you want to iterate over a Pagination object, use (for example)
Customer.query.paginate(page=1, per_page=1).items
which is a collection of the items for that page.
See the API docs.
If you want to iterate over a Pagination object, use (for example)
Customer.query.paginate(page=1, per_page=1).items
which is a collection of the items for that page.