Work on event and lookup related end points, methods, and models

This commit is contained in:
Scott Idem
2021-11-10 17:57:51 -05:00
parent 413b44b4d2
commit 0b3b066b9b
9 changed files with 44 additions and 14 deletions

View File

@@ -53,7 +53,7 @@ async def patch_event_location_obj_exist_v4(
fail_any = fail_any,
return_outline = False,
): pass
else: return mk_resp(data=False, status_code=400, response=response, status_message='The event location was not created. Check the field names and data types.')
else: return mk_resp(data=False, status_code=400, response=response, status_message='The event location was not created or updated. Check the field names and data types.')
if update_event_location_obj_result:
if return_obj:
@@ -125,13 +125,16 @@ async def get_event_location_obj(
# ### BEGIN ### API Event Location ### get_event_obj_event_location_list() ###
# Updated 2021-10-09
# Updated 2021-11-10
@router.get('/event/{event_id}/event/location/list', response_model=Resp_Body_Base)
async def get_event_obj_event_location_list(
event_id: str = Query(..., min_length=11, max_length=22),
enabled: str = 'enabled',
hidden: str = 'not_hidden',
limit: int = 500,
inc_event_file_list: bool = False,
inc_event_session_list: bool = False,
inc_file_count: bool = False,
x_account_id: str = Header(...),
by_alias: Optional[bool] = True,
exclude_unset: Optional[bool] = True,
@@ -143,9 +146,6 @@ async def get_event_obj_event_location_list(
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, response=response)
response_data = None
# log.setLevel(logging.DEBUG) # DEBUG, INFO, WARNING, ERROR, EXCEPTION, CRITICAL
# Updated 2021-07-28
if event_location_rec_list_result := get_event_location_rec_list(
event_id = event_id,
@@ -162,6 +162,9 @@ async def get_event_obj_event_location_list(
exclude_unset = exclude_unset,
# model_as_dict = model_as_dict,
enabled = enabled,
inc_event_file_list = inc_event_file_list,
inc_event_session_list = inc_event_session_list,
inc_file_count = inc_file_count,
):
event_location_result_list.append(load_event_location_result)
else:

View File

@@ -193,8 +193,8 @@ async def get_event_session_event_presentation_li(
inc_event_person: bool = False, # Intended for event_presenter
# inc_event_person_list: bool = False,
inc_person: bool = False, # Intended for event_presenter > event_person
review: str = 'ready', # ready, not_ready, all
approved: str = 'approved', # approved, not_approved, all
review: str = 'all', # ready, not_ready, all
approved: str = 'all', # approved, not_approved, all
hidden: str = 'not_hidden', # hidden, not_hidden, all
inc_file_count: bool = False, # NOTE: file counts are from separate views
x_account_id: str = Header(...),

View File

@@ -242,6 +242,7 @@ async def get_event_presenter_obj(
inc_contact: bool = False, # Under person
inc_event_abstract_list: bool = False, # Part of event_presenter and under event_person obj
inc_event_badge: bool = False, # Under event_person obj
inc_event_cfg: bool = False,
inc_event_device_list: bool = False, # Part of event_presenter and under event_person obj
inc_event_file_list: bool = False, # Part of event_presenter and under event_person obj
inc_event_person: bool = False,
@@ -274,6 +275,7 @@ async def get_event_presenter_obj(
inc_contact = inc_contact,
inc_event_abstract_list = inc_event_abstract_list,
inc_event_badge = inc_event_badge,
inc_event_cfg = inc_event_cfg,
inc_event_device_list = inc_event_device_list,
inc_event_file_list = inc_event_file_list,
inc_event_person = inc_event_person,

View File

@@ -540,7 +540,7 @@ async def get_event_session_obj(
# ### BEGIN ### API Event Session ### get_event_event_session_obj_li() ###
# Updated 2021-08-26
@router.get('/event/{event_id}/session/list', response_model=Resp_Body_Base)
@router.get('/event/{event_id}/event/session/list', response_model=Resp_Body_Base)
async def get_event_event_session_obj_li(
event_id: str = Query(..., min_length=11, max_length=22),
enabled: str = 'enabled', # enabled, disabled, all
@@ -555,8 +555,8 @@ async def get_event_event_session_obj_li(
# inc_event_person_list: bool = False,
inc_person: bool = False, # Intended for event_presenter > event_person
inc_poc_event_person: bool = False,
review: str = 'ready', # ready, not_ready, all
approved: str = 'approved', # approved, not_approved, all
review: str = 'all', # ready, not_ready, all
approved: str = 'all', # approved, not_approved, all
hidden: str = 'not_hidden', # hidden, not_hidden, all
inc_file_count: bool = False, # NOTE: file counts are from separate views
x_account_id: str = Header(...),

View File

@@ -31,7 +31,7 @@ async def get_lookup_li(
log.setLevel(logging.WARNING) # DEBUG, INFO, WARNING, ERROR, EXCEPTION, CRITICAL
log.debug(locals())
allowed_lookup_tables = ['country', 'country_subdivision', 'event_session_type', 'file_purpose', 'membership_group_status', 'membership_person_status', 'membership_type_status', 'order_status', 'post_topic', 'product_type', 'time_zone', 'user_status']
allowed_lookup_tables = ['country', 'country_subdivision', 'education_degree', 'education_level', 'event_session_type', 'file_purpose', 'membership_group_status', 'membership_person_status', 'membership_type_status', 'order_status', 'post_topic', 'product_type', 'time_zone', 'user_status']
if for_lookup_name in allowed_lookup_tables: pass
else: