database - Google App Engine - ndb sorting by string? (Python) -


is possible sort query results stringproperty?

i have following:

class user(ndb.model):      first_name = ndb.stringproperty(indexed=false)      last_name = ndb.stringproperty(indexed=false) 

now if want retrieve stored entries database, use (it works):

user_query = user.query(ancestor=user_key(user_name)) 

but want result ordered first_name, use this:

user_query = user.query(ancestor=user_key(user_name)).order(-user.first_name) 

this not work! don't know wrong , not produce errors, no results show anymore. empty table :-(

you need index order work.


Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -