If all you want to do is retrieve the entity with a specific key,
Person.get(key) is much faster and simpler.

-Nick Johnson

On Jan 16, 6:24 am, Alexander Kojevnikov <alexan...@kojevnikov.com>
wrote:
> > I am messing with google app engine queries being very new to it
> > how can we match a string with __key__
> > 'SELECT * FROM Person WHERE __key__=:bkey', bkey=str(value)
> > This query is not working
> > What is wrong with this?
>
> You need to pass an instance of db.Key class as a parameter.
>
> Is 'value' a string representation of the key? If so, the code will
> look like this:
>
> query = db.GqlQuery('SELECT * FROM Person '
>                     'WHERE __key__ = :bkey',
>                     bkey=db.Key(value))
>
> See 
> alsohttp://code.google.com/appengine/docs/datastore/queriesandindexes.htm...
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to