mitsuhiko/flask-sqlalchemy — Issue #70: Support __iter__ on Pagination instances.
Author: rduplain
Created: 2012-02-01 20:06:36+00:00
State: open

I never remember to call .items, and I was just reminded of this when getting a new developer spun up. Instead of:

for obj in MyModel.query.paginate(1).items: pass

I expect:

for obj in MyModel.query.paginate(1): pass

... because SQLAlchemy's query API does this everywhere. This fails, because a Pagination instance is not iterable.