Working on integration with Svelte and cont_edu
This commit is contained in:
@@ -21,7 +21,7 @@ def load_cont_edu_cert_person_obj(
|
||||
exclude_unset: bool = True,
|
||||
model_as_dict: bool = False,
|
||||
enabled: str = 'enabled', # enabled, disabled, all
|
||||
inc_cont_edu_cert:bool=False
|
||||
inc_cont_edu_cert: bool = False,
|
||||
) -> Cont_Edu_Cert_Person_Base|dict|bool:
|
||||
# log.setLevel(logging.WARNING) # DEBUG, INFO, WARNING, ERROR, EXCEPTION, CRITICAL
|
||||
log.debug(locals())
|
||||
|
||||
@@ -32,7 +32,11 @@ class Cont_Edu_Cert_Base(BaseModel):
|
||||
|
||||
name: Optional[str]
|
||||
description: Optional[str]
|
||||
|
||||
title: Optional[str]
|
||||
course_name: Optional[str]
|
||||
credits: Optional[int]
|
||||
credits_text: Optional[str]
|
||||
datetime_start: Optional[datetime.datetime]
|
||||
datetime_end: Optional[datetime.datetime]
|
||||
location: Optional[str]
|
||||
|
||||
@@ -262,9 +262,14 @@ async def search_cont_edu_cert_person_obj_li(
|
||||
# ### END ### API Cont Edu Cert Person ### search_cont_edu_cert_person_obj_li() ###
|
||||
|
||||
|
||||
@router.get('/cont_edu/cert/person/{obj_id}', response_model=Resp_Body_Base)
|
||||
# ### BEGIN ### API Cont Edu Cert Person ### get_cont_edu_cert_person_obj() ###
|
||||
# Updated 2021-08-05
|
||||
@router.get('/cont_edu/cert/person/{cont_edu_cert_person_id}', response_model=Resp_Body_Base)
|
||||
async def get_cont_edu_cert_person_obj(
|
||||
obj_id: str = Query(..., min_length=1, max_length=22),
|
||||
cont_edu_cert_person_id: str = Query(..., min_length=1, max_length=22),
|
||||
limit: int = 500, # For now this covers any included objects or object lists
|
||||
enabled: str = 'enabled', # For now this covers any included objects or object lists
|
||||
inc_cont_edu_cert: bool = False,
|
||||
x_account_id: str = Header(...),
|
||||
by_alias: Optional[bool] = True,
|
||||
exclude_unset: Optional[bool] = True,
|
||||
@@ -272,14 +277,21 @@ async def get_cont_edu_cert_person_obj(
|
||||
log.setLevel(logging.WARNING) # DEBUG, INFO, WARNING, ERROR, EXCEPTION, CRITICAL
|
||||
log.debug(locals())
|
||||
|
||||
obj_type = 'cont_edu_cert_person'
|
||||
result = get_obj_template(
|
||||
obj_type=obj_type,
|
||||
obj_id=obj_id,
|
||||
by_alias=True,
|
||||
exclude_unset=True,
|
||||
if cont_edu_cert_person_id := redis_lookup_id_random(record_id_random=cont_edu_cert_person_id, table_name='cont_edu_cert_person'): pass
|
||||
else: return mk_resp(data=None, status_code=404)
|
||||
|
||||
cont_edu_cert_person_obj = load_cont_edu_cert_person_obj(
|
||||
cont_edu_cert_person_id = cont_edu_cert_person_id,
|
||||
limit = limit,
|
||||
by_alias = by_alias,
|
||||
exclude_unset = exclude_unset,
|
||||
# model_as_dict = model_as_dict,
|
||||
enabled = enabled,
|
||||
inc_cont_edu_cert = inc_cont_edu_cert,
|
||||
)
|
||||
return result
|
||||
cont_edu_cert_person_dict = cont_edu_cert_person_obj.dict(by_alias=by_alias, exclude_unset=exclude_unset)
|
||||
return mk_resp(data=cont_edu_cert_person_dict)
|
||||
# ### END ### API Cont Edu Cert Person ### get_cont_edu_cert_person_obj() ###
|
||||
|
||||
|
||||
# ### BEGIN ### API Cont Edu Cert Person ### get_account_obj_cont_edu_cert_person_list() ###
|
||||
|
||||
Reference in New Issue
Block a user