【发布时间】:2014-02-24 13:56:45
【问题描述】:
这可能是最愚蠢的问题,我对此表示歉意,但我很困惑
我有以下实体:
class Profile(ndb.Model):
name = ndb.StringProperty()
identifier = ndb.StringProperty()
pic = ndb.BlobKeyProperty() # stores the key to the profile picture blob
我想删除上述实体的“pic”属性值,使其看起来像从未为“pic”分配任何值一样新鲜。我不打算删除完整的实体。以下方法是否正确:
qry = Profile.query(Profile.identifier==identifier)
result_record_list = qry.fetch()
if result_record_list:
result_record_list[0].pic.delete() # or result_record_list[0].pic = none # or undefined or null
我正在单独删除此 blob 键引用的实际 blob
【问题讨论】:
标签: google-app-engine python-2.7 app-engine-ndb