Entity path is a list of (kind, id or key name) tuple. Key is the encoded string which represents an entity path. So id or key name is a part of a key.
If you know the reference kind, you can only store the reference entity's id or key name, and use db.Key.from_path() to build the full key. It would cost less space to store id or key name only, and you don't need to do prefetch. ---------- keakon My blog(Chinese): www.keakon.net Blog source code: https://bitbucket.org/keakon/doodle/ On Mon, Jan 3, 2011 at 9:16 AM, rahul jain <[email protected]> wrote: > Hi, > > I have model defined like this > > class Menu(db.Model): > type = db.StringProperty() # can we do something like > db.StringProperty(key=True) > desc = db.StringProperty() > > class Item(db.Model): > desc = db.StringProperty() > tied = db.ReferenceProperty(Menu, collection_name='item_list') > > > What should be the entity key and key name for this ? > Ideally menu type should be the key. > Also for my datastore I have key, ID keyname (why so many) > > Thanks for your help. > > --RJ > > -- > 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]<google-appengine%[email protected]> > . > For more options, visit this group at > http://groups.google.com/group/google-appengine?hl=en. > -- 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.
