Work on data store and related

This commit is contained in:
Scott Idem
2022-07-27 18:05:08 -04:00
parent c87531aff7
commit dd1b3c0b1b
10 changed files with 167 additions and 26 deletions

View File

@@ -25,7 +25,7 @@ def load_data_store_obj(
exclude_unset: bool = True,
model_as_dict: bool = False,
) -> Data_Store_Base|dict|bool:
log.setLevel(logging.DEBUG) # DEBUG, INFO, WARNING, ERROR, EXCEPTION, CRITICAL
log.setLevel(logging.INFO) # DEBUG, INFO, WARNING, ERROR, EXCEPTION, CRITICAL
log.debug(locals())
if data_store_rec := sql_select(table_name='v_data_store', record_id=data_store_id): pass
@@ -69,10 +69,14 @@ def load_data_store_obj_w_code(
data['account_id'] = account_id
data['code'] = code
log.debug(data)
log.warning(f'Can we get past this?????????? {code}')
sql_enabled, data['enable'] = sql_enable_part(table_name='data_store', enabled=enabled) # Reasonably safe return str and bool
sql_limit = sql_limit_offset_part(limit=limit, offset=offset) # Reasonably safe return str
log.debug(data)
log.warning(f'Where are we now??????????? {code}')
sql = f"""
SELECT *
@@ -87,6 +91,7 @@ def load_data_store_obj_w_code(
ORDER BY `data_store`.account_id DESC, `data_store`.created_on DESC, `data_store`.updated_on DESC
{sql_limit};
"""
# log.setLevel(logging.DEBUG) # DEBUG, INFO, WARNING, ERROR, EXCEPTION, CRITICAL
log.debug(sql)
if data_store_rec_li_result := sql_select(data=data, sql=sql, as_list=True):
@@ -109,6 +114,7 @@ def load_data_store_obj_w_code(
log.debug(data_store_obj)
else: pass
# log.setLevel(logging.DEBUG) # DEBUG, INFO, WARNING, ERROR, EXCEPTION, CRITICAL
log.debug(data_store_obj_li)
return data_store_obj_li