you need to do one sort in datastore , while other in memory. (google don't allow both simultaneously..).
there should be less people with same height than there are with same age. ( this could be subjective...if your database span over all the ages , there are 5 year old to 80 year old . a span of 75 , while most height data fits within 150 to 200 range .. span of 50....). so , you should first sort by height in datastore and than sort by ages in memory... just my one and a half cent. :) regards, Gopal Patel On Mar 29, 9:01 am, manuelaraoz <[email protected]> wrote: > Hi there! > > I want to know if this can be done efficiently: > I need to sort some database's entities first by one property, and if > there's a tie, to sort them by other property > > for example, lets have the following: > > class Person(db.Model): > > age = IntegerProperty() > height_in_cm = IntegerProperty() > > how can I sort first by age, but if I have two people with the same > age, to sort them by height_in_cm > > I hope I made myself clear > and thanks in advance for your help > > Manuel --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
