Working on event person, registration, badge, session, presentation, and presenter create and update. _v3 things

This commit is contained in:
Scott Idem
2021-08-24 20:31:00 -04:00
parent 25ebdb6e76
commit 7859d1d2b2
12 changed files with 513 additions and 71 deletions

View File

@@ -42,10 +42,10 @@ async def post_event_session_obj(
return result
# ### BEGIN ### API Event Session ### post_event_session_obj_new() ###
# ### BEGIN ### API Event Session ### post_event_session_obj_new_v3() ###
# Updated 2021-08-21 (all new)
@router.post('/new', response_model=Resp_Body_Base)
async def post_event_session_obj_new(
@router.post('/new_v3', response_model=Resp_Body_Base)
async def post_event_session_obj_new_v3(
event_session_obj: Event_Session_Base,
create_sub_obj: bool = False,
fail_any: bool = True, # Fail if any thing goes wrong for sub objects
@@ -61,9 +61,9 @@ async def post_event_session_obj_new(
# There should probably be a check for the event ID before calling the create function?
if create_event_session_obj_result := create_event_session_obj(
event_id = event_session_obj.event_id,
event_session_obj_new=event_session_obj,
create_sub_obj=create_sub_obj,
fail_any=fail_any
event_session_obj_new = event_session_obj,
create_sub_obj = create_sub_obj,
fail_any = fail_any
): pass
else: return mk_resp(data=False, status_code=400, response=response, status_message='The event session was not created. Check the field names and data types.')
@@ -83,12 +83,13 @@ async def post_event_session_obj_new(
return mk_resp(data=data, response=response, status_message='The event session was created.')
else:
return mk_resp(data=False, status_code=400, response=response, status_message='The result from trying to create an event session was unexpected.')
# ### BEGIN ### API Event Session ### post_event_session_obj_new() ###
# ### BEGIN ### API Event Session ### post_event_session_obj_new_v3() ###
# ### BEGIN ### API Event Session ### patch_event_session_obj_v3() ###
@router.patch('/{event_session_id}/v3', response_model=Resp_Body_Base)
async def patch_event_session_obj_v3(
# ### BEGIN ### API Event Session ### patch_event_session_obj_exist_v3() ###
# Updated 2021-08-24
@router.patch('/{event_session_id}/exist_v3', response_model=Resp_Body_Base)
async def patch_event_session_obj_exist_v3(
event_session_obj: Event_Session_Base,
event_session_id: str = Query(..., min_length=11, max_length=22),
create_sub_obj: bool = False,
@@ -128,7 +129,7 @@ async def patch_event_session_obj_v3(
return mk_resp(data=data, response=response, status_message='The event session was created.')
else:
return mk_resp(data=False, status_code=400, response=response, status_message='The result from trying to create an event session was unexpected.')
# ### END ### API Event Session ### patch_event_session_obj_v3() ###
# ### END ### API Event Session ### patch_event_session_obj_exist_v3() ###
@router.patch('/{obj_id}', response_model=Resp_Body_Base)