Work on order reports and related
This commit is contained in:
@@ -133,7 +133,7 @@ def create_export_file(
|
||||
rm_id: bool = True,
|
||||
export_type: str = 'CSV', # CSV, Excel
|
||||
) -> bool|str:
|
||||
log.setLevel(logging.DEBUG) # DEBUG, INFO, WARNING, ERROR, EXCEPTION, CRITICAL
|
||||
log.setLevel(logging.INFO) # DEBUG, INFO, WARNING, ERROR, EXCEPTION, CRITICAL
|
||||
log.debug(locals())
|
||||
|
||||
hosted_tmp_path = settings.PATH_HOSTED_TMP_ROOT
|
||||
@@ -146,8 +146,10 @@ def create_export_file(
|
||||
file_dest_w_subdir = os.path.join(subdirectory_dest, filename)
|
||||
log.info(f'File Dest With Subdir: {file_dest_w_subdir}')
|
||||
|
||||
if column_name_li: pass
|
||||
if column_name_li:
|
||||
log.info('Using column name list passed')
|
||||
else:
|
||||
log.info('Using an auto generated column name list')
|
||||
column_name_li = list(data_dict_list[0].keys())
|
||||
log.debug(column_name_li)
|
||||
|
||||
@@ -159,6 +161,9 @@ def create_export_file(
|
||||
log.info(f'Removing column name: {column_name}')
|
||||
log.debug(column_name_li)
|
||||
|
||||
|
||||
# column_name_li = ['order_line_id_random', 'order_id_random', 'product_id_random', 'product_type', 'product_name', 'quantity', 'amount', 'dollar_amount', 'message', 'person_id_random', 'person_given_name', 'person_family_name', 'person_display_name', 'person_full_name', 'person_contact_email', 'person_contact_cc_email', 'person_contact_address_name', 'person_contact_address_organization_name', 'person_contact_address_line_1', 'person_contact_address_line_2', 'person_contact_address_line_3', 'person_contact_address_city', 'person_contact_address_country_subdivision_code', 'person_contact_address_state_province', 'person_contact_address_postal_code', 'person_contact_address_country_alpha_2_code', 'person_contact_address_country_name', 'person_contact_address_country', 'order_status', 'order_created_on', 'order_updated_on']
|
||||
|
||||
data_dataframe = pandas.DataFrame(data_dict_list)
|
||||
log.debug(data_dataframe)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user