A lot of work on event related modules
This commit is contained in:
@@ -211,24 +211,80 @@ async def get_event_obj_li(
|
||||
return mk_resp(data=False, status_code=404)
|
||||
|
||||
|
||||
@router.get('/{obj_id}', response_model=Resp_Body_Base)
|
||||
# ### BEGIN ### API Event ### get_event_obj() ###
|
||||
# Working well as of 2021-06-04. Using as a template for other routes.
|
||||
@router.get('/{event_id}', response_model=Resp_Body_Base)
|
||||
async def get_event_obj(
|
||||
obj_id: str = Query(..., min_length=1, max_length=22),
|
||||
event_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_contact_1: bool = False,
|
||||
inc_contact_2: bool = False,
|
||||
inc_contact_3: bool = False,
|
||||
inc_event_abstract_list: bool = False,
|
||||
inc_event_badge_list: bool = False,
|
||||
inc_event_device_list: bool = False,
|
||||
inc_event_exhibit_list: bool = False,
|
||||
inc_event_file_list: bool = False,
|
||||
inc_event_location: bool = False,
|
||||
inc_event_location_list: bool = False,
|
||||
inc_event_person_list: bool = False,
|
||||
inc_event_presentation_list: bool = False,
|
||||
inc_event_presenter_cat: bool = False,
|
||||
inc_event_presenter_list: bool = False,
|
||||
inc_event_registration_list: bool = False,
|
||||
inc_event_session_list: bool = False,
|
||||
inc_event_track: bool = False,
|
||||
inc_event_track_list: bool = False,
|
||||
inc_event_cfg: bool = False,
|
||||
inc_event_registration_cfg: bool = False,
|
||||
inc_location_address: bool = False,
|
||||
inc_poc_event_person: bool = False,
|
||||
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.setLevel(logging.DEBUG) # DEBUG, INFO, WARNING, ERROR, EXCEPTION, CRITICAL
|
||||
log.debug(locals())
|
||||
|
||||
obj_type = 'event'
|
||||
result = get_obj_template(
|
||||
obj_type=obj_type,
|
||||
obj_id=obj_id,
|
||||
by_alias=True,
|
||||
exclude_unset=True,
|
||||
)
|
||||
return result
|
||||
if event_id := redis_lookup_id_random(record_id_random=event_id, table_name='event'): pass
|
||||
else:
|
||||
return mk_resp(data=None, status_code=404)
|
||||
|
||||
if event_obj := load_event_obj(
|
||||
event_id=event_id,
|
||||
enabled=enabled,
|
||||
limit=limit,
|
||||
inc_contact_1=inc_contact_1,
|
||||
inc_contact_2=inc_contact_2,
|
||||
inc_contact_3=inc_contact_3,
|
||||
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_exhibit_list=inc_event_exhibit_list,
|
||||
inc_event_file_list=inc_event_file_list,
|
||||
inc_event_location=inc_event_location,
|
||||
inc_event_location_list=inc_event_location_list,
|
||||
inc_event_person_list=inc_event_person_list,
|
||||
inc_event_presentation_list=inc_event_presentation_list,
|
||||
inc_event_presenter_cat=inc_event_presenter_cat,
|
||||
inc_event_presenter_list=inc_event_presenter_list,
|
||||
inc_event_registration_list=inc_event_registration_list,
|
||||
inc_event_session_list=inc_event_session_list,
|
||||
inc_event_track=inc_event_track,
|
||||
inc_event_track_list=inc_event_track_list,
|
||||
inc_event_cfg=inc_event_cfg,
|
||||
inc_event_registration_cfg=inc_event_registration_cfg,
|
||||
inc_location_address=inc_location_address,
|
||||
inc_poc_event_person=inc_poc_event_person,
|
||||
):
|
||||
# event_dict = event_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_obj)
|
||||
# ### END ### API Event ### get_event_obj() ###
|
||||
|
||||
|
||||
@router.delete('/{obj_id}', response_model=Resp_Body_Base)
|
||||
|
||||
@@ -158,4 +158,63 @@ async def post_event_person_new(
|
||||
return mk_resp(data=False)
|
||||
|
||||
log.debug(event_person_obj)
|
||||
return mk_resp(data=event_person_obj)
|
||||
return mk_resp(data=event_person_obj)
|
||||
|
||||
|
||||
# ### BEGIN ### API Event Person ### get_event_person_obj() ###
|
||||
# Working well as of 2021-06-04. Using as a template for other routes.
|
||||
@router.get('/{event_person_id}', response_model=Resp_Body_Base)
|
||||
async def get_event_person_obj(
|
||||
event_person_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_event_abstract_list: bool = False,
|
||||
inc_event_badge: bool = False,
|
||||
#inc_event_device_list: bool = False,
|
||||
#inc_event_exhibit_list: bool = False,
|
||||
inc_event_file_list: bool = False,
|
||||
#inc_event_location_list: bool = False,
|
||||
#inc_event_person_list: bool = False,
|
||||
inc_event_presentation_list: bool = False,
|
||||
#inc_event_presenter_list: bool = False,
|
||||
inc_event_registration: bool = False,
|
||||
#inc_event_track: bool = False,
|
||||
inc_person: bool = False,
|
||||
inc_user: bool = False,
|
||||
x_account_id: str = Header(...),
|
||||
by_alias: Optional[bool] = True,
|
||||
exclude_unset: Optional[bool] = True,
|
||||
):
|
||||
log.setLevel(logging.DEBUG) # DEBUG, INFO, WARNING, ERROR, EXCEPTION, CRITICAL
|
||||
log.debug(locals())
|
||||
|
||||
if event_person_id := redis_lookup_id_random(record_id_random=event_person_id, table_name='event_person'): pass
|
||||
else:
|
||||
return mk_resp(data=None, status_code=404)
|
||||
|
||||
if event_person_obj := load_event_person_obj(
|
||||
event_person_id=event_person_id,
|
||||
enabled=enabled,
|
||||
limit=limit,
|
||||
inc_event_abstract_list=inc_event_abstract_list,
|
||||
inc_event_badge=inc_event_badge,
|
||||
#inc_event_device_list=inc_event_device_list,
|
||||
#inc_event_exhibit_list=inc_event_exhibit_list,
|
||||
inc_event_file_list=inc_event_file_list,
|
||||
#inc_event_location=inc_event_location,
|
||||
#inc_event_person_list=inc_event_person_list,
|
||||
inc_event_presentation_list=inc_event_presentation_list,
|
||||
#inc_event_presenter_list=inc_event_presenter_list,
|
||||
inc_event_registration=inc_event_registration,
|
||||
#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_person_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_person_obj)
|
||||
# ### END ### API Event ### get_event_person_obj() ###
|
||||
|
||||
@@ -228,6 +228,62 @@ async def get_event_session_obj(
|
||||
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)
|
||||
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_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_list: bool = False,
|
||||
inc_event_presentation_list: bool = False,
|
||||
inc_event_presenter_cat: bool = False,
|
||||
inc_event_presenter_list: bool = False,
|
||||
inc_event_registration_list: bool = False,
|
||||
inc_event_track: bool = False,
|
||||
inc_poc_event_person: bool = False,
|
||||
x_account_id: str = Header(...),
|
||||
by_alias: Optional[bool] = True,
|
||||
exclude_unset: Optional[bool] = True,
|
||||
):
|
||||
log.setLevel(logging.DEBUG) # DEBUG, INFO, WARNING, ERROR, EXCEPTION, CRITICAL
|
||||
log.debug(locals())
|
||||
|
||||
if event_session_id := redis_lookup_id_random(record_id_random=event_session_id, table_name='event_session'): pass
|
||||
else:
|
||||
return mk_resp(data=None, status_code=404)
|
||||
|
||||
if event_session_obj := load_event_session_obj(
|
||||
event_session_id=event_session_id,
|
||||
enabled=enabled,
|
||||
limit=limit,
|
||||
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_list=inc_event_person_list,
|
||||
inc_event_presentation_list=inc_event_presentation_list,
|
||||
inc_event_presenter_cat=inc_event_presenter_cat,
|
||||
inc_event_presenter_list=inc_event_presenter_list,
|
||||
inc_event_registration_list=inc_event_registration_list,
|
||||
inc_event_track=inc_event_track,
|
||||
inc_poc_event_person=inc_poc_event_person,
|
||||
):
|
||||
# event_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)
|
||||
# ### END ### API Event ### get_event_session_obj() ###
|
||||
|
||||
|
||||
@router.delete('/{obj_id}', response_model=Resp_Body_Base)
|
||||
async def delete_event_session_obj(
|
||||
obj_id: str = Query(..., min_length=1, max_length=22),
|
||||
|
||||
Reference in New Issue
Block a user