def write_mutual_fund_to_file(self, mutual_fund_inst, sheet_id, row_id):
data_list = [mutual_fund_inst.fund_id,
mutual_fund_inst.fund_name,
mutual_fund_inst.fund_size,
mutual_fund_inst.mer,
mutual_fund_inst.status,
mutual_fund_inst.min_inve_initial,
mutual_fund_inst.category,
mutual_fund_inst.inve_style,
mutual_fund_inst.inve_objective_strategy,
mutual_fund_inst.growth_of_ten_thousand_YTD,
mutual_fund_inst.growth_of_ten_thousand_1month,
mutual_fund_inst.growth_of_ten_thousand_1year,
mutual_fund_inst.growth_of_ten_thousand_3year,
mutual_fund_inst.growth_of_ten_thousand_5year,
mutual_fund_inst.growth_of_ten_thousand_10year,
mutual_fund_inst.growth_fund_YTD,
mutual_fund_inst.growth_fund_1month,
mutual_fund_inst.growth_fund_1year,
mutual_fund_inst.growth_fund_3year,
mutual_fund_inst.growth_fund_5year,
mutual_fund_inst.growth_fund_10year,
mutual_fund_inst.growth_comp_index_YTD,
mutual_fund_inst.growth_comp_index_1month,
mutual_fund_inst.growth_comp_index_1year,
mutual_fund_inst.growth_comp_index_3year,
mutual_fund_inst.growth_comp_index_5year,
mutual_fund_inst.growth_comp_index_10year,
mutual_fund_inst.growth_comp_category_YTD,
mutual_fund_inst.growth_comp_category_1month,
mutual_fund_inst.growth_comp_category_1year,
mutual_fund_inst.growth_comp_category_3year,
mutual_fund_inst.growth_comp_category_5year,
mutual_fund_inst.growth_comp_category_10year]
self.xlsx_file_lock.acquire()
for i in range(len(data_list)):
cell = self.xlsx_file_inst.get_sheet_by_name(str(sheet_id)).cell(row=row_id+1, column=i+1)
cell.value = data_list[i]
self.xlsx_file_lock.release()
logger.debug("Write data: %s", data_list)
评论列表
文章目录