Minor changes

This commit is contained in:
Scott Idem
2022-09-27 20:53:12 -04:00
parent cb50ae8089
commit a18388e841
9 changed files with 51 additions and 2 deletions

View File

@@ -36,6 +36,7 @@ def load_event_location_obj(
enabled: str = 'enabled', # enabled, disabled, all
hidden: str = 'hidden', # hidden, not_hidden, all
limit: int = 1000,
offset: int = 0,
by_alias: bool = True,
exclude_unset: bool = True,
model_as_dict: bool = False,
@@ -70,7 +71,34 @@ def load_event_location_obj(
#account_id = event_location_rec.get('account_id', None)
event_id = event_location_rec.get('event_id', None)
# if inc_event_device_list: pass
# Updated 2022-09-27
if inc_event_device_list:
log.info('Need to include event device list...')
from app.methods.event_device_methods import get_event_device_rec_list, load_event_device_obj
if event_device_rec_list_result := get_event_device_rec_list(
for_type = 'event_location',
for_id = event_location_id,
enabled = enabled,
limit = limit,
offset = offset,
):
event_device_result_list = []
for event_device_rec in event_device_rec_list_result:
if load_event_device_result := load_event_device_obj(
event_device_id = event_device_rec.get('event_device_id', None),
enabled = enabled,
):
event_device_result_list.append(load_event_device_result)
else:
event_device_result_list.append(None)
log.debug(event_device_result_list)
event_location_obj.event_device_list = event_device_result_list
elif isinstance(event_device_rec_list_result, list):
event_location_obj.event_device_list = []
else:
event_location_obj.event_device_list = None
# if inc_event_file_list: pass
# Updated 2021-10-21
@@ -244,6 +272,7 @@ def get_event_location_rec_list(
enabled: str = 'enabled', # enabled, disabled, all
hidden: str = 'not_hidden', # hidden, not_hidden, all
limit: int = 100,
offset: int = 0,
) -> list|bool:
log.setLevel(logging.INFO) # DEBUG, INFO, WARNING, ERROR, EXCEPTION, CRITICAL
log.debug(locals())

View File

@@ -214,7 +214,6 @@ def load_event_obj(
if event_device_rec_list_result := get_event_device_rec_list(
for_type = 'event',
for_id = event_id,
# event_id = event_id,
enabled = enabled,
):
event_device_result_list = []
@@ -311,10 +310,12 @@ def load_event_obj(
if load_event_location_result := load_event_location_obj(
event_location_id = event_location_rec.get('event_location_id', None),
enabled = enabled,
inc_event_device_list = inc_event_device_list,
inc_event_file_list = inc_event_file_list,
inc_event_presentation_list = inc_event_presentation_list,
inc_event_presenter_list = inc_event_presenter_list,
inc_event_session_list = inc_event_session_list,
inc_file_count = inc_file_count,
limit = limit,
by_alias = by_alias,
exclude_unset = exclude_unset,
@@ -360,6 +361,7 @@ def load_event_obj(
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_file_count = inc_file_count,
inc_person = inc_person,
inc_poc_event_person = inc_poc_event_person,
by_alias = by_alias,

View File

@@ -47,6 +47,7 @@ def load_event_presentation_obj(
inc_person: bool = False,
inc_user: bool = False,
limit: int = 1000,
offset: int = 0,
by_alias: bool = True,
exclude_unset: bool = True,
model_as_dict: bool = False,
@@ -238,6 +239,7 @@ def get_event_presentation_rec_list(
hidden: str = 'not_hidden', # hidden, not_hidden, all
review: str = 'all', # ready, not_ready, all
limit: int = 100,
offset: int = 0,
) -> list|bool:
log.setLevel(logging.INFO) # DEBUG, INFO, WARNING, ERROR, EXCEPTION, CRITICAL
log.debug(locals())

View File

@@ -41,6 +41,7 @@ def load_event_presenter_obj(
inc_person: bool = False, # Using load_event_person_obj
inc_user: bool = False, # Using load_event_person_obj
limit: int = 1000,
offset: int = 0,
by_alias: bool = True,
exclude_unset: bool = False,
model_as_dict: bool = False,
@@ -208,6 +209,7 @@ def get_event_presenter_rec_list(
hidden: str = 'not_hidden', # hidden, not_hidden, all
enabled: str = 'enabled', # enabled, disabled, all
limit: int = 100,
offset: int = 0,
) -> list|bool:
log.setLevel(logging.DEBUG) # DEBUG, INFO, WARNING, ERROR, EXCEPTION, CRITICAL
log.debug(locals())

View File

@@ -52,6 +52,7 @@ def load_event_session_obj(
inc_person: bool = False,
inc_user: bool = False,
limit: int = 1000,
offset: int = 0,
by_alias: bool = True,
exclude_unset: bool = True,
model_as_dict: bool = False,
@@ -328,6 +329,7 @@ def get_event_session_rec_list(
hidden: str = 'not_hidden', # hidden, not_hidden, all
review: str = 'all', # ready, not_ready, all
limit: int = 100,
offset: int = 0,
) -> list|bool:
log.setLevel(logging.INFO) # DEBUG, INFO, WARNING, ERROR, EXCEPTION, CRITICAL
log.debug(locals())

View File

@@ -63,6 +63,9 @@ class Event_Device_Base(BaseModel):
trigger_open_session_id: Optional[str]
trigger_open_session_id: Optional[str]
trigger_recording_start: Optional[bool]
trigger_recording_stop: Optional[bool]
trigger_reset: Optional[bool]
trigger_show_admin: Optional[str]
@@ -72,6 +75,9 @@ class Event_Device_Base(BaseModel):
host_file_temp_path: Optional[str] # Path for copied and renamed temporary files from hash file cache directory
recording_path: Optional[str] # Path to save recordings
record_audio: Optional[bool] # Record
record_video: Optional[bool] # Record
check_event_loop_period: Optional[int]
check_event_device_loop_period: Optional[int]
check_event_location_loop_period: Optional[int]

View File

@@ -42,6 +42,8 @@ class Event_Location_Base(BaseModel):
# New internal use fields to help with logistics and planning 2022-09-15
internal_use: Optional[bool] # Will hide from moderators, presenters, non support people, etc
record_audio: Optional[bool] # Record the sessions in this location
record_video: Optional[bool] # Record the sessions in this location
internal_notes: Optional[str] # general notes
internal_notes_access: Optional[str] # accessibility
internal_notes_av: Optional[str] # audio video

View File

@@ -85,6 +85,8 @@ class Event_Session_Base(BaseModel):
# New internal use fields to help with logistics and planning 2022-09-15
internal_use: Optional[bool] # Will hide from moderators, presenters, non support people, etc
record_audio: Optional[bool] # Record the sessions in this location
record_video: Optional[bool] # Record the sessions in this location
internal_notes: Optional[str] # general notes
internal_notes_access: Optional[str] # accessibility
internal_notes_av: Optional[str] # audio video

View File

@@ -140,6 +140,7 @@ async def patch_event_location_obj_exist_v4(
@router.get('/event/location/{event_location_id}', response_model=Resp_Body_Base)
async def get_event_location_obj(
event_location_id: str = Query(..., min_length=11, max_length=22),
inc_event_device_list: bool = False,
inc_event_file_list: bool = False,
inc_event_file_internal_use_list: bool = False,
inc_event_presentation_list: bool = False,
@@ -162,6 +163,7 @@ async def get_event_location_obj(
if event_location_obj := load_event_location_obj(
event_location_id = event_location_id,
inc_event_device_list = inc_event_device_list,
inc_event_file_list = inc_event_file_list,
inc_event_file_internal_use_list = inc_event_file_internal_use_list,
inc_event_presentation_list = inc_event_presentation_list,