我已经创建了一个自定义NDB属性,我正在寻找一种方法来引用当前存储的属性值(已经保存到数据存储区的值)_to_base_type
方法: / p>
class CustomProperty(StructuredProperty):
def __init__(self, **kwds):
super(CustomProperty, self).__init__(CustomModel, **kwds)
def _validate(self, value):
assert isinstance(value, CustomObject)
def _to_base_type(self, value):
# reference currently stored value here <--
return CustomModel()
def _from_base_type(self, value):
return CustomObject()
这可能吗?