Working on user and person
This commit is contained in:
@@ -38,7 +38,7 @@ class User_New_Base(BaseModel):
|
|||||||
allow_auth_key: Optional[int]
|
allow_auth_key: Optional[int]
|
||||||
|
|
||||||
enable: Optional[bool] = False
|
enable: Optional[bool] = False
|
||||||
enable_from: Optional[datetime.datetime]
|
enable_from: Optional[datetime.datetime] = datetime.datetime.now(datetime.timezone.utc)
|
||||||
enable_to: Optional[datetime.datetime] = datetime.datetime.now(datetime.timezone.utc) + datetime.timedelta(days=365)
|
enable_to: Optional[datetime.datetime] = datetime.datetime.now(datetime.timezone.utc) + datetime.timedelta(days=365)
|
||||||
|
|
||||||
#super: Optional[bool] = False
|
#super: Optional[bool] = False
|
||||||
|
|||||||
@@ -19,20 +19,20 @@ router = APIRouter()
|
|||||||
|
|
||||||
@router.post('', response_model=Resp_Body_Base)
|
@router.post('', response_model=Resp_Body_Base)
|
||||||
async def post_address_obj(
|
async def post_address_obj(
|
||||||
obj: Address_Base,
|
address_obj: 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,
|
||||||
include: Optional[list] = [],
|
#include: Optional[list] = [],
|
||||||
exclude: Optional[list] = [],
|
#exclude: Optional[list] = [],
|
||||||
exclude_unset: Optional[bool] = True,
|
exclude_unset: Optional[bool] = True,
|
||||||
exclude_none: Optional[bool] = True,
|
exclude_none: Optional[bool] = True,
|
||||||
):
|
):
|
||||||
log.setLevel(logging.WARNING) # DEBUG, INFO, WARNING, ERROR, EXCEPTION, CRITICAL
|
log.setLevel(logging.DEBUG) # DEBUG, INFO, WARNING, ERROR, EXCEPTION, CRITICAL
|
||||||
log.debug(locals())
|
log.debug(locals())
|
||||||
|
|
||||||
obj_type = 'address'
|
obj_type = 'address'
|
||||||
obj_data_dict = obj.dict(by_alias=False, exclude_unset=True)
|
obj_data_dict = address_obj.dict(by_alias=False, exclude_unset=True)
|
||||||
result = post_obj_template(
|
result = post_obj_template(
|
||||||
obj_type=obj_type,
|
obj_type=obj_type,
|
||||||
data=obj_data_dict,
|
data=obj_data_dict,
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ async def post_contact_obj(
|
|||||||
by_alias: Optional[bool] = True,
|
by_alias: Optional[bool] = True,
|
||||||
exclude_unset: Optional[bool] = True,
|
exclude_unset: Optional[bool] = True,
|
||||||
):
|
):
|
||||||
log.setLevel(logging.WARNING) # DEBUG, INFO, WARNING, ERROR, EXCEPTION, CRITICAL
|
log.setLevel(logging.DEBUG) # DEBUG, INFO, WARNING, ERROR, EXCEPTION, CRITICAL
|
||||||
log.debug(locals())
|
log.debug(locals())
|
||||||
|
|
||||||
obj_type = 'contact'
|
obj_type = 'contact'
|
||||||
|
|||||||
Reference in New Issue
Block a user