Clean up some of the models and debug
This commit is contained in:
@@ -29,7 +29,7 @@ class Address_Base(BaseModel):
|
|||||||
account_id: Optional[int]
|
account_id: Optional[int]
|
||||||
|
|
||||||
for_type: Optional[str]
|
for_type: Optional[str]
|
||||||
for_id_random: Optional[str]
|
for_id_random: Optional[str] = None
|
||||||
for_id: Optional[int]
|
for_id: Optional[int]
|
||||||
|
|
||||||
#organization: Optional[Organization_Base] = Organization_Base()
|
#organization: Optional[Organization_Base] = Organization_Base()
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ base_fields['obj_id'] = {}
|
|||||||
base_fields['obj_name'] = {}
|
base_fields['obj_name'] = {}
|
||||||
base_fields['obj_notes'] = {}
|
base_fields['obj_notes'] = {}
|
||||||
|
|
||||||
base_fields['for_id_random'] = xxx_id_random_field_schema_default
|
base_fields['for_id_random'] = xxx_id_random_field_schema_default # NOTE: This field may need to be set = None in the actual models with this field.
|
||||||
|
|
||||||
#xxx_id_random_field_schema['alias'] = 'order_id_random'
|
#xxx_id_random_field_schema['alias'] = 'order_id_random'
|
||||||
#base_fields['id_random'] = xxx_id_random_field_schema_default
|
#base_fields['id_random'] = xxx_id_random_field_schema_default
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ class User_Role_Base(BaseModel):
|
|||||||
role_id: Optional[int]
|
role_id: Optional[int]
|
||||||
|
|
||||||
for_type: Optional[str]
|
for_type: Optional[str]
|
||||||
for_id_random: Optional[str]
|
for_id_random: Optional[str] = None
|
||||||
for_id: Optional[int]
|
for_id: Optional[int]
|
||||||
|
|
||||||
enable: Optional[bool]
|
enable: Optional[bool]
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ from ..log import *
|
|||||||
from app.config import settings
|
from app.config import settings
|
||||||
from app.db_sql import *
|
from app.db_sql import *
|
||||||
|
|
||||||
from ..models.address_model import *
|
from ..models.address_model import Address_Base
|
||||||
from ..models.response_model import *
|
from ..models.response_model import *
|
||||||
|
|
||||||
|
|
||||||
@@ -20,13 +20,12 @@ router = APIRouter()
|
|||||||
|
|
||||||
|
|
||||||
@router.post('')
|
@router.post('')
|
||||||
async def post_address_obj(
|
async def post_address_obj(address: Address_Base,
|
||||||
address: Address_Base,
|
x_account_id: str = Header(...),
|
||||||
x_account_id: str = Header(...),
|
return_obj: Optional[bool] = True,
|
||||||
return_obj: Optional[bool] = True,
|
by_alias: Optional[bool] = True,
|
||||||
by_alias: Optional[bool] = True,
|
exclude_unset: Optional[bool] = True,
|
||||||
exclude_unset: Optional[bool] = True,
|
):
|
||||||
):
|
|
||||||
log.setLevel(logging.DEBUG) # DEBUG, INFO, WARNING, ERROR, EXCEPTION, CRITICAL
|
log.setLevel(logging.DEBUG) # DEBUG, INFO, WARNING, ERROR, EXCEPTION, CRITICAL
|
||||||
log.debug(locals())
|
log.debug(locals())
|
||||||
|
|
||||||
@@ -53,4 +52,3 @@ async def post_address_obj(
|
|||||||
resp_data = base_name(**sql_select_result).dict(by_alias=by_alias, exclude_unset=exclude_unset)
|
resp_data = base_name(**sql_select_result).dict(by_alias=by_alias, exclude_unset=exclude_unset)
|
||||||
|
|
||||||
return mk_resp(data=resp_data)
|
return mk_resp(data=resp_data)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user