I am using flask-excel to export a list of dict to excel file. This is my code.
return excel.make_response_from_records(
result,
"csv",
file_name="export_data",
dest_encoding="gb2312"
)
I successfully got an Excel file with columns sorted by 'a b c'. How can I control the order? Thanks.
Please supply a list of ordered dictionary instances. According to the source, yield_from_records() will follow your order, as long as the first one is of an ordered dictionary.