如果我有一个带引用属性的对象,那么在引用属性上调用.key()或.key().id()方法会导致从数据存储中检索它吗?或者我可以从没有触发请求的那些人那里获得价值吗?
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()
Run Code Online (Sandbox Code Playgroud)