Correction on this post :(

  A.C.get_value_for_datastore(a)

  It is not necessary to call 'key()' because the object that gets
returns IS the key.

On Oct 2, 3:02 pm, Rafe <[EMAIL PROTECTED]> wrote:
>   Mazia is correct, there is no guarantee that this will work.  In
> fact, it is very likely it will not work in the future.  We may in the
> future implement lazy loading so that you can access the key directly
> without loading the entity (a.C.key()) however, for now, this is
> guaranteed to work:
>
>   A.C.get_value_for_datastore(a).key()
>
> On Sep 29, 6:23 pm, Andy Freeman <[EMAIL PROTECTED]> wrote:
>
> > Is there an approved way to copy aReferencePropertyfrom 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
-~----------~----~----~----~------~----~------~--~---

Reply via email to