Hi, the model class already has a built in function for retrieving an entity by key name:
my_entity = MyModel.get_by_key_name(key_name) Also, key names are unique within a data model. Your example shows an iteration over multiple entities which will never happen if you are querying on a key name. Hope this helps. --Joe On Aug 29, 2:33 pm, "S.Prymak" <[email protected]> wrote: > I have to query datastore for entities with key names which are greater or > equals to specified string. Something like this: > > def get_pages_by_key_name(key): > p = models.Page(key_name=key) > query = GqlQuery("SELECT * FROM Page WHERE ???? :1", p.key.name()) > return [i for i in query] > > How can I do that? -- 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.
