示例#1
0
def upload_array(struct_type):
    if struct_type == "array":
        array = request.get_array(field_name='file')
        return excel.make_response_from_array(array, 'xls')
    elif struct_type == "dict":
        adict = request.get_dict(field_name='file')
        return excel.make_response_from_dict(adict, 'xls')
    elif struct_type == "records":
        records = request.get_records(field_name='file')
        return excel.make_response_from_records(records, 'xls')
    elif struct_type == "book":
        book = request.get_book(field_name='file')
        return excel.make_response(book, 'xls')
    elif struct_type == "book_dict":
        book_dict = request.get_book_dict(field_name='file')
        return excel.make_response_from_book_dict(book_dict, 'xls')
示例#2
0
def swtich_file_name(file_type, file_name):
    return excel.make_response(pe.Sheet(["a", "b", "c"]), file_type, file_name=file_name)
示例#3
0
def switch(file_type):
    sheet = request.get_sheet(field_name='file')
    return excel.make_response(sheet, file_type)