Work on redoing orders and related. A lot of code clean up. I think it works pretty well.

This commit is contained in:
Scott Idem
2022-01-19 18:51:24 -05:00
parent 9dbbc26d06
commit d1d3b30ece
8 changed files with 281 additions and 102 deletions

View File

@@ -51,7 +51,7 @@ async def get_obj_id_order_line_list(
for_obj_id = obj_id,
from_datetime = from_datetime,
to_datetime = to_datetime,
prod_type = prod_type,
product_for_type = prod_type,
status = status,
full_detail = full_detail,
# enabled = enabled,

View File

@@ -95,7 +95,7 @@ async def patch_order_obj(
commons: Common_Route_Params = Depends(common_route_params),
):
log.setLevel(logging.DEBUG) # DEBUG, INFO, WARNING, ERROR, EXCEPTION, CRITICAL
log.setLevel(logging.INFO) # DEBUG, INFO, WARNING, ERROR, EXCEPTION, CRITICAL
log.debug(locals())
# ### SECTION ### Secondary data validation
@@ -424,7 +424,7 @@ async def get_order_obj(
# model_as_dict = model_as_dict,
):
log.debug(load_order_obj_result)
order_dict = load_order_obj_result.dict(by_alias=by_alias, exclude_unset=False) # NOTE NOTE NOTE NOTE exclude_unset is forced to False for now. Will return more fields than is ideal. Need to create another Order_Line_Base. Probably Order_Line_OUT_Base
order_dict = load_order_obj_result.dict(by_alias=commons.by_alias, exclude_unset=False) # NOTE NOTE NOTE NOTE exclude_unset is forced to False for now. Will return more fields than is ideal. Need to create another Order_Line_Base. Probably Order_Line_OUT_Base
log.info('Loading successful. Returning result')
return mk_resp(data=order_dict, response=commons.response)
elif isinstance(load_order_obj_result, list) or load_order_obj_result is None: # Empty list or None