Working on all the routes, methods, and models.
This commit is contained in:
@@ -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() ###
|
||||
|
||||
Reference in New Issue
Block a user