Morten Bek Ditlevsen writes:
 > Hi there,
 > I have an entity with a list property containing keys:
 >
 >   favorites = db.ListProperty(db.Key, indexed=False)
 >
 > I suddenly came to wonder:
 > If I check if a key is in the list like this:
 > 
 > if thekey in user.favorites:
 > 
 > will that by any chance try and fetch any entities in the user.favorites
 > list?
 > 
 > I don't think so, but I would like to make sure! :-)

When you do foo in bar it's actually calling Python methods, not the datastore 
ops., and since
Python sees favorites as a list of keys it should not fetch the entities.

If you were to do index this and do it in datastore side ("WHERE favorites = 
thekey") it might have to
"un-marshal" the property and do a normal lookup, but I don't think the 
slowdown is noticeable.

-- 
Federico

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