If I have an object with a reference property, will calling the .key() or .key().id() method on the reference property cause it to be retrieved from the data store? Or can I can I get the value from those without a request being triggered?
class MyObject(db.Model):
reference = db.ReferenceProperty()
myObj = MyObject( reference = myOtherObject )
myObj.put()
# Will this retrieve the key without doing a get for the object?
temp1 = myObj.reference.key()
# What about this?
temp2 = myObj.reference.key().id()
Accessing the property from the model instance will de-reference it (it will be fetched):
To get the key without de-referencing, use: