get_by_id() is faster than querying (it actually translates to db.get
()).

If you still want to use a query, you can construct a Key object and
pass it to your query:

key = db.Key.from_path('Pet', id)
query = db.GqlQuery('SELECT * FROM Pet WHERE __key__ = :key", key=key)

On Dec 3, 4:39 am, Danny ZI <[EMAIL PROTECTED]> wrote:
> how can i use GQL to query for a key id and not the KEY object
> same as doing this:
>
> query = Pet.get_by_id(id);
>
> but doing this throw a GQL like this
>
> query = db.GqlQuery("SELECT * FROM Pet WHERE key.id = :keyId",
>                         keyid = id);
>
> *i also know you can use __key__ to get to the key object how can i
> get to the id ?
>
> and i dont want to use the full key object only the id as in this
> example
> is there any way of doing this?
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to