Esempio n. 1
0
 def post(self):
     csv = self.request.files.get('csv')
     if csv:
         csv = io.BytesIO(csv[0]['body'])
     _id = self.get_argument('id') 
     # ipdb.set_trace()
     result = data.addCSVToMap(_id, csv)
     content = json.dumps(data.getMaps())
     return Response(mimetype='application/json', status=200, response=content)
Esempio n. 2
0
def attach_file():
    '''
    Attach the file of an given _id,
    thus the data is in the multipart-form
    '''
    _id = request.form.get('id')
    csv = request.files.get('csv')
    result = data.addCSVToMap(_id, csv)
    content = json.dumps(data.getMaps())
    return Response(mimetype='application/json', status=200, response=content)