2
我很难改变默认的_get_for_dict()方法。 这是我的代码看起来的时刻:覆盖默认_get_for_dict()为ndb属性
class ImageProperty(ndb.BlobKeyProperty):
def _get_for_dict(self, entity):
value = super(ImageProperty, self)._get_for_dict(entity)
if value:
return images.get_serving_url(value)
else:
return None
我没有那么多成覆盖方法,以及具有NDB麻烦iself ...概念 基本上我想做的事:我的存储数据存储密钥作为BlobKeyProperty,但是当它作为字典检索时,我想获取图像服务URL。
非常感谢
非常感谢,似乎工作 – lkshrk