问题
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:
BlobInfo.key is a method, not a property, so call it: blob.key()
来源:https://stackoverflow.com/questions/24045315/expected-blobkey-but-instead-i-get-a-blobinfo-object-how-to-get-blobkey-from-b