You're right, it's not entirely clear why Model.get_by_id(ids)
requires all entities to have the same parent, while Model.get(keys)
doesn't have that requirement.  Presumably some implementation
detail.  But whatever the reason, using Model.get(keys) is a good
idea.  I'll give that a shot when I get a chance.  Thanks for the
idea!

On Jan 29, 4:06 pm, Danny Tuppeny <da...@tuppeny.com> wrote:
> I don't know if I was drunk when I sent this message, but I don't
> think it makes any sense at all. If you're calling get() on SS, it's
> quite clear what the kind is!
>
> On Jan 28, 7:20 am, Danny Tuppeny <da...@tuppeny.com> wrote:
>
> > On Jan 24, 12:29 am, dburns <drrnb...@gmail.com> wrote:
>
> > > Making a User instance the parent of a SS (snapshot) instance seems
> > > like a natural fit, except then I can't fetch all the favourites via:
> > > favs = SS.get_by_id(user.fav_ids).  The reason is that all parents
> > > have to be the same to use SS.get_by_id (according 
> > > tohttp://code.google.com/appengine/docs/python/datastore/modelclass.htm...),
> > > but those favourites may have been created by various users (hence the
> > > parents would be different).
>
> > Can you use SS.get(keys) instead?
>
> > I think the reason that get_by_id requires the parent is because IDs
> > are not full keys (and presumably an ID can be duplicated for
> > different kinds). If you create Keys for them (you'll need to know
> > their Kind), you could call SS.get(keys) and get them all in one go.
>
>

-- 
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-appeng...@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