从BlobInfo对象获取BlobKey的最佳方法是什么?
def get(self):
blobs = BlobInfo.all()
#something is missing here
for blob in blobs:
if not Content.query().filter(ndb.BlobKeyProperty("blobKey") == blob.key).count(1): #ERROR
blob.delete() ^
**how do you do make this a normal BlobKey?**
#Error
BadValueError: Expected BlobKey, got <bound method BlobInfo.key of
<google.appengine.ext.blobstore.blobstore.BlobInfo object at 0x048B87D0>>
谢谢!
答案 0 :(得分:1)
BlobInfo.key是一个方法,而不是属性,所以请调用它:blob.key()