Hello all,

I posted this as comment, but wanted to share it here, in case no one
reads the comments there... hoping for some help.
The class is at: 
http://appengine-cookbook.appspot.com/recipe/efficient-paging-for-any-query-and-any-model

Thanks a lot.
Mohamed.


Did some testing about paging through more than the fetch limit of
1000, and found that it works fine if the query had no "order" set.
When I add an order, it yields weird results... it just keeps
returning more and more pages, way beyond the actual total number of
records I have created, with is 2000. Please see bellow. could anyone
help me fix this? is it fixable?
Thanks a lot.

>>>Model.count_all()

2000

>>>q=PagerQuery(Model);next=None

>>>prev, results, next = q.fetch(900, 
>>>next);(len(results),results[0].name,results[-1].name,next,prev)

(900, u'name_1', u'name_900', 'Xz0xNiZf...', None)

>>>prev, results, next = q.fetch(900, 
>>>next);(len(results),results[0].name,results[-1].name,next,prev)

(900, u'name_901', u'name_1800', 'Xz0xNiZfX2...', '-Xz0xNiZf...')

>>>prev, results, next = q.fetch(900, 
>>>next);(len(results),results[0].name,results[-1].name,next,prev)

(200, u'name_1801', u'name_2000', None, '-Xz0xNi...')

>>>q=PagerQuery(Model).order('name');next=None

>>>prev, results, next = q.fetch(900, 
>>>next);(len(results),results[0].name,results[-1].name,next,prev)

(900, u'name_1', u'name_1808', 'Xz0xNi...', None)

>>>prev, results, next = q.fetch(900, 
>>>next);(len(results),results[0].name,results[-1].name,next,prev)

(900, u'name_1809', u'name_818', 'Xz0xNiZuY...', '-Xz0xNiZu...')

>>>prev, results, next = q.fetch(900, 
>>>next);(len(results),results[0].name,results[-1].name,next,prev)

(900, u'name_819', u'name_1718', 'Xz0xN...', '-Xz0xN...')

>>>prev, results, next = q.fetch(900, 
>>>next);(len(results),results[0].name,results[-1].name,next,prev)

(900, u'name_1719', u'name_728', 'Xz0x...', '-Xz0xN...')

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to