【发布时间】:2011-11-13 20:29:44
【问题描述】:
我想要我的应用程序存储的所有电子邮件地址的逗号分隔列表。对于常规请求来说太大了,将其写入 blobstore 也是一个太大的请求:
class CSVHandler(webapp2.RequestHandler):
def get(self):
entities = Entity.all().fetch(10000)
s = ''
for entity in entities:
s= s+","+str(entity.email)
file_name = files.blobstore.create(mime_type='application/octet-stream')
with files.open(file_name, 'a') as f:
f.write(s)
files.finalize(file_name)
blob_key = files.blobstore.get_blob_key(file_name)
我可以将其作为任务、队列、后端或其他东西来代替吗?
提前感谢您的任何建议
【问题讨论】:
标签: python google-app-engine google-cloud-datastore csv