Working on all the routes, methods, and models.

This commit is contained in:
Scott Idem
2021-06-18 17:49:32 -04:00
parent 938aabb2a8
commit ce44e93b4d
17 changed files with 614 additions and 285 deletions

View File

@@ -14,6 +14,8 @@ from app.models.product_models import Product_Base
def load_product_obj(
product_id: int|str,
limit: int = 1000,
by_alias: bool = True,
exclude_unset: bool = True,
model_as_dict: bool = False,
) -> Product_Base:
log.setLevel(logging.WARNING) # DEBUG, INFO, WARNING, ERROR, EXCEPTION, CRITICAL
@@ -32,7 +34,7 @@ def load_product_obj(
log.error(e.json())
if model_as_dict:
return product_obj.dict(by_alias=True, exclude_unset=True) # pylint: disable=no-member
return product_obj.dict(by_alias=by_alias, exclude_unset=exclude_unset) # pylint: disable=no-member
else:
return product_obj
# ### END ### API Product Methods ### load_product_obj() ###