Google app engine 如何保存属于实体的blob键列表?

Google app engine 如何保存属于实体的blob键列表?,google-app-engine,python-2.7,blob,webapp2,Google App Engine,Python 2.7,Blob,Webapp2,使用my webapp,用户可以在GAE中将图像上传为blob。我想在文章和图像(blob)之间建立一个简单的连接,因此我尝试了以下方法: class Article(db.Model): blobs = db.ListProperty(db.Key) 然后在blobstoreuploadhandler中: for upload in self.get_uploads(): try: article.blobs.append(upload.key()) 但随后

使用my webapp,用户可以在GAE中将图像上传为blob。我想在文章和图像(blob)之间建立一个简单的连接,因此我尝试了以下方法:

class Article(db.Model):
    blobs = db.ListProperty(db.Key)
然后在blobstoreuploadhandler中:

for upload in self.get_uploads():
    try:
        article.blobs.append(upload.key())
但随后出现了一个例外:

 /upload_form 404 3753ms 1kb Mozilla/5.0 (Windows NT 6.1; rv:28.0) Gecko/20100101 Firefox/28.0 module=default version=leakagefix
0.1.0.30 - - [20/Mar/2014:04:46:27 -0700] "POST /upload_form HTTP/1.1" 404 1331 "http://www.koolbusiness.com/ai" "Mozilla/5.0 (Windows NT 6.1; rv:28.0) Gecko/20100101 Firefox/28.0" "www.koolbusiness.com" ms=3754 cpu_ms=2036 cpm_usd=0.000149 app_engine_release=1.9.1 instance=00c61b117c8167bb98b5f7f69bd68254df45fe64
E 2014-03-20 12:46:27.190
There was an exception:Items in the blobs list must all be Key instances
E 2014-03-20 12:46:27.216
Items in the blobs list must all be Key instances

你能告诉我应该怎么做以及这次尝试有什么问题吗?

Blob键与数据存储键不同。使用BlobKey类: