I have a model Post
and want to iterate through them in batches of 10 in a loop.
This is what I've tried, but does not work:
batched_posts = Post.query.yield_for(10)
for posts in batched_posts.partitions(): # error: 'Query' object has no attribute 'partitions'
print(len(posts)) # prints 10 ten times if I have 100 posts