There are ways to get the key from a db.ReferenceProperty without
fetching the entity from the datastore.
I posted a metaclass that generated {name}_key fields for
db.ReferenceProperty s named {name}.
Also, there's get_value_for_datastore.
class A(db.Model):
pass
class B(db.Model):
a = db.ReferenceProperty(A)
a = A()
a.put()
b = B()
b.a = a.key()
assert a.key() == B.a.get_value_for_datastore(b)
On Nov 13, 7:42 am, tigrillo <[EMAIL PROTECTED]>
wrote:
> For the sake of efficient, it will be nice if ReferenceProperty let's
> us return the Key optionally instead of the Entity.
>
> Thanks
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---