parents = db.get([Entity.parent.get_value_for_datastore(entity) for
entity in result])

Is more efficient because you only do 1 call to the datastore, for
multiple objects.

2009/1/2 Rodrigo Moraes <[email protected]>:
>
> On Fri, Jan 2, 2009 at 1:59 AM, Tiago S. wrote:
>> I´m facing the exactly same problem. I thought about querying all(with
>> a fetch(100), in my case) the children with name 'Joe', and then put
>> all the parent keys in a list(with a list comprehension, maybe). With
>> all the keys, query the Parent using Parent.get(list).
>
> You can simply do [entity.parent for entity in result]. If you have a
> ReferenceProperty, the first time you call the property "parent" to
> get the key, it'll be fetched. So building and fetching a list would
> only be possible if you store an additional property with the parent
> key - or you'd be doing double fetch.
>
> -- rodrigo
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
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