0
我無法將blob_name傳輸到隊列中,因此我可以讀出信息並對其進行處理。 Blob的信息或內容基本上只是文本列表(CSV)。我也嘗試過使用blob_key,但都導致相同的錯誤。將Blob_values傳輸到隊列
# I create the blob - works fine, checked in Dashboard
file_name = files.blobstore.create(mime_type='text/comma-separated-values',_blobinfo_uploaded_filename=str(datetime.now()))
with files.open(file_name, 'a') as f:
f.write(low)
files.finalize(file_name)
# Transferring the variables to the queue
taskqueue.add(url='/filtering_brands', params={'filter_name' : filter_name, 'user' : user, 'lowkey' : file_name})
self.redirect('/?sent=True')
class Queue(webapp2.RequestHandler):
def post(self):
# Requesting the variables
filter_name = self.request.get('filter_name')
user = self.request.get('user')
lowkey = self.request.get('lowkey')
blob_key = files.blobstore.get_blob_key(lowkey)
# This is (apparently) the part that doesn't work
low = blobstore.BlobReader(blob_key)
# Process the data and transfer it to an email script
這是我收到的錯誤:
TypeError: object of type 'BlobReader' has no len()
get_blob_key()得到了一個意想不到的關鍵字參數 'blob_key' - 任何想法? – oliver13 2013-04-23 16:14:52