I would like to do a "keys_only" query for a collection property:

class User(db.Model):

  name = db.StringProperty()
  ...etc...

class FavoriteColors(db.Model):
  color = db.StringProperty()
  user = db.ReferenceProperty(User,collection_name="colors")

if user.colors:
  for color in user.colors(keys_only=True).order('name'):
    ... etc...

I know that "user.colors" is not a function and therefore "user.colors
(keys_only=True)" is not a valid approach. However, this is to
illustrate what I would like to see possible.

In other words, since "user.colors" is a Query object, shouldn't I be
able to send it the "keys_only=True" parameter when it's constructed?
There are a LOT of times when I only want those keys, so I can go grab
them from Memcache. But as soon as I try to look at them, the
Datastore fetches the entire Entity from the Datastore.

Anyone else work something around 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