Skip to content

Allows for SQLAlchemy Query object to be paginated through Flask-SQLAlchemy#265

Closed
neurosnap wants to merge 1 commit intopallets-eco:masterfrom
neurosnap:paginate
Closed

Allows for SQLAlchemy Query object to be paginated through Flask-SQLAlchemy#265
neurosnap wants to merge 1 commit intopallets-eco:masterfrom
neurosnap:paginate

Conversation

@neurosnap
Copy link

http://stackoverflow.com/a/15734565/1713216

I ran into this issue recently and thought adding a quick fix in Flask-SQLAlchemy could be useful to others.

What this PR does is allows an SQLAlchemy Query object: db.session.query() to use all the same functionality as BaseQuery.paginate().

This very simply moves the primary functionality from BaseQuery.paginate() into its own function and now BaseQuery.paginate() calls that function.

@neurosnap neurosnap changed the title Allows for sqlalchemy Query object to be paginated through flask sqlalchemy Allows for sqlalchemy Query object to be paginated through Flask-SQLAlchemy Feb 21, 2015
@neurosnap neurosnap changed the title Allows for sqlalchemy Query object to be paginated through Flask-SQLAlchemy Allows for SQLAlchemy Query object to be paginated through Flask-SQLAlchemy Feb 21, 2015
@immunda immunda mentioned this pull request Apr 24, 2015
@davidism
Copy link
Member

davidism commented Dec 5, 2015

#328 means this works now

@davidism davidism closed this Dec 5, 2015
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 5, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments