Expected BlobKey but instead I get a BlobInfo obje

2019-09-09 02:40发布

What's the best way to get a BlobKey from a BlobInfo object?

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>>

Thanks!!

1条回答
可以哭但决不认输i
2楼-- · 2019-09-09 02:52

BlobInfo.key is a method, not a property, so call it: blob.key()

查看更多
登录 后发表回答