A lot of work on event related modules. Also a lot of clean up.
This commit is contained in:
@@ -208,26 +208,6 @@ async def get_event_session_obj_li(
|
||||
return mk_resp(data=False, status_code=404)
|
||||
|
||||
|
||||
@router.get('/{obj_id}', response_model=Resp_Body_Base)
|
||||
async def get_event_session_obj(
|
||||
obj_id: str = Query(..., min_length=1, max_length=22),
|
||||
x_account_id: str = Header(...),
|
||||
by_alias: Optional[bool] = True,
|
||||
exclude_unset: Optional[bool] = True,
|
||||
):
|
||||
log.setLevel(logging.WARNING) # DEBUG, INFO, WARNING, ERROR, EXCEPTION, CRITICAL
|
||||
log.debug(locals())
|
||||
|
||||
obj_type = 'event_session'
|
||||
result = get_obj_template(
|
||||
obj_type=obj_type,
|
||||
obj_id=obj_id,
|
||||
by_alias=True,
|
||||
exclude_unset=True,
|
||||
)
|
||||
return result
|
||||
|
||||
|
||||
# ### BEGIN ### API Event Session ### get_event_session_obj() ###
|
||||
# Working well as of 2021-06-04. Using as a template for other routes.
|
||||
@router.get('/{event_session_id}', response_model=Resp_Body_Base)
|
||||
@@ -235,11 +215,14 @@ async def get_event_session_obj(
|
||||
event_session_id: str = Query(..., min_length=1, max_length=22),
|
||||
enabled: str = 'enabled', # For now this covers any included objects or object lists
|
||||
limit: int = 500, # For now this covers any included objects or object lists
|
||||
inc_address: bool = False, # Under contact
|
||||
inc_contact: bool = False, # Under person
|
||||
inc_event_abstract_list: bool = False,
|
||||
inc_event_badge_list: bool = False,
|
||||
inc_event_device_list: bool = False,
|
||||
inc_event_file_list: bool = False,
|
||||
inc_event_location: bool = False,
|
||||
inc_event_person: bool = False, # Under event_presenter
|
||||
inc_event_person_list: bool = False,
|
||||
inc_event_presentation_list: bool = False,
|
||||
inc_event_presenter_cat: bool = False,
|
||||
@@ -247,6 +230,8 @@ async def get_event_session_obj(
|
||||
inc_event_registration_list: bool = False,
|
||||
inc_event_track: bool = False,
|
||||
inc_poc_event_person: bool = False,
|
||||
inc_person: bool = False, # Under event_person
|
||||
inc_user: bool = False, # Under event_person
|
||||
x_account_id: str = Header(...),
|
||||
by_alias: Optional[bool] = True,
|
||||
exclude_unset: Optional[bool] = True,
|
||||
@@ -262,11 +247,14 @@ async def get_event_session_obj(
|
||||
event_session_id=event_session_id,
|
||||
enabled=enabled,
|
||||
limit=limit,
|
||||
inc_address=inc_address,
|
||||
inc_contact=inc_contact,
|
||||
inc_event_abstract_list=inc_event_abstract_list,
|
||||
inc_event_badge_list=inc_event_badge_list,
|
||||
inc_event_device_list=inc_event_device_list,
|
||||
inc_event_file_list=inc_event_file_list,
|
||||
inc_event_location=inc_event_location,
|
||||
inc_event_person=inc_event_person,
|
||||
inc_event_person_list=inc_event_person_list,
|
||||
inc_event_presentation_list=inc_event_presentation_list,
|
||||
inc_event_presenter_cat=inc_event_presenter_cat,
|
||||
@@ -274,13 +262,16 @@ async def get_event_session_obj(
|
||||
inc_event_registration_list=inc_event_registration_list,
|
||||
inc_event_track=inc_event_track,
|
||||
inc_poc_event_person=inc_poc_event_person,
|
||||
inc_person=inc_person,
|
||||
inc_user=inc_user,
|
||||
):
|
||||
# event_dict = event_session_obj.dict(by_alias=by_alias, exclude_unset=exclude_unset)
|
||||
event_session_dict = event_session_obj.dict(by_alias=by_alias, exclude_unset=exclude_unset)
|
||||
pass
|
||||
else:
|
||||
return mk_resp(data=False, status_code=400) # Bad Request
|
||||
|
||||
return mk_resp(data=event_session_obj)
|
||||
return mk_resp(data=event_session_dict)
|
||||
#return mk_resp(data=event_session_obj)
|
||||
# ### END ### API Event ### get_event_session_obj() ###
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user