Hi, The method that you are using currently works, but there is no guarantee that it will continue to work in the future - by which I mean that the current API design only specifies that ReferenceProperty is fetched from the datastore when referenced.
We've had requests that there be a way to expose only the key of the reference, and not the actual entity, and I think this is a valid feature request. I don't believe it's filed in the tracker, so you should do that, and those interested in this feature should star the issue. -Marzia On Mon, Sep 29, 2008 at 6:23 PM, Andy Freeman <[EMAIL PROTECTED]> wrote: > > Is there an approved way to copy a ReferenceProperty from one entity > to another without fetching the referred to entity from the datastore? > > In other words, > > class C(db.Model): > ... > > class A(db.Model): > C = db.ReferenceProperty(reference_class=C) > > class B(db.Model): > C = db.ReferenceProperty(reference_class=C) > > a = {some query} > b = B() > # I would like to do the next assignment without retrieving the > relevant entity > # from the data store. > b.C = a.C > > Yes, I know that a._C.id() can be used to read the id, but that > doesn't seem to be part of the documented interface. > > > > --~--~---------~--~----~------------~-------~--~----~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en -~----------~----~----~----~------~----~------~--~---