[google-appengine] Re: Sorting more than 1000 entities

2009-05-19 Thread daiski
Thanks Zheng and Nick! On May 19, 3:41 pm, "Nick Johnson (Google)" wrote: > Hi Daiski, > > You can sort your results by using the .order() method on a Query object: > > q = Student.all().order('last_name'). > > The datastore only supports fetching 1000 results per query. If you > really need to

[google-appengine] Re: Sorting more than 1000 entities

2009-05-19 Thread Nick Johnson (Google)
Hi Daiski, You can sort your results by using the .order() method on a Query object: q = Student.all().order('last_name'). The datastore only supports fetching 1000 results per query. If you really need to retrieve more, you can use multiple queries and paginate, for example see Zheng's solutio

[google-appengine] Re: Sorting more than 1000 entities

2009-05-19 Thread 狼外婆
The problem is not about sorting. The problem is that you cannot get more than 1000 entries. You need to "paginate" on the last_name property (if it is guaranteed to be unique). all_students = [ ] next = '' while True: students = Student.all().order('last_name').filter('last_name >', next).fe