Minor changes. Added even_location_list to event_session.
This commit is contained in:
@@ -8,7 +8,7 @@ from app.lib_general import log, logging, logger_reset
|
|||||||
|
|
||||||
# from app.methods.event_methods import load_event_obj
|
# from app.methods.event_methods import load_event_obj
|
||||||
from app.methods.event_file_methods import load_event_file_obj_list
|
from app.methods.event_file_methods import load_event_file_obj_list
|
||||||
from app.methods.event_location_methods import load_event_location_obj
|
from app.methods.event_location_methods import load_event_location_obj, get_event_location_rec_list
|
||||||
from app.methods.event_person_methods import load_event_person_obj, update_event_person_obj
|
from app.methods.event_person_methods import load_event_person_obj, update_event_person_obj
|
||||||
from app.methods.event_presentation_methods import create_event_presentation_obj, create_update_event_presentation_obj_v4, load_event_presentation_obj, update_event_presentation_obj_v3
|
from app.methods.event_presentation_methods import create_event_presentation_obj, create_update_event_presentation_obj_v4, load_event_presentation_obj, update_event_presentation_obj_v3
|
||||||
# from app.methods.event_presenter_methods import load_event_presenter_obj
|
# from app.methods.event_presenter_methods import load_event_presenter_obj
|
||||||
@@ -37,6 +37,7 @@ def load_event_session_obj(
|
|||||||
inc_event_file_list: bool = False,
|
inc_event_file_list: bool = False,
|
||||||
inc_event_file_internal_use_list: bool = False,
|
inc_event_file_internal_use_list: bool = False,
|
||||||
inc_event_location: bool = False,
|
inc_event_location: bool = False,
|
||||||
|
inc_event_location_list: bool = False,
|
||||||
inc_event_person: bool = False,
|
inc_event_person: bool = False,
|
||||||
inc_event_person_profile: bool = False,
|
inc_event_person_profile: bool = False,
|
||||||
inc_event_person_list: bool = False,
|
inc_event_person_list: bool = False,
|
||||||
@@ -174,6 +175,34 @@ def load_event_session_obj(
|
|||||||
else:
|
else:
|
||||||
event_session_obj.event_location = None
|
event_session_obj.event_location = None
|
||||||
|
|
||||||
|
# Updated 2022-09-20
|
||||||
|
if inc_event_location_list:
|
||||||
|
log.setLevel(logging.DEBUG) # DEBUG, INFO, WARNING, ERROR, EXCEPTION, CRITICAL
|
||||||
|
log.info('Need to include event location list...')
|
||||||
|
|
||||||
|
if event_location_rec_list_result := get_event_location_rec_list(
|
||||||
|
event_id = event_id,
|
||||||
|
enabled = enabled, # enabled, disabled, all
|
||||||
|
hidden = 'all', # hidden, not_hidden, all
|
||||||
|
limit = limit,
|
||||||
|
):
|
||||||
|
event_location_result_list = []
|
||||||
|
for event_location_rec in event_location_rec_list_result:
|
||||||
|
if load_event_location_result := load_event_location_obj(
|
||||||
|
event_location_id = event_location_rec.get('event_location_id', None),
|
||||||
|
enabled = enabled,
|
||||||
|
limit = limit,
|
||||||
|
):
|
||||||
|
event_location_result_list.append(load_event_location_result)
|
||||||
|
else:
|
||||||
|
event_location_result_list.append(None)
|
||||||
|
log.debug(event_location_result_list)
|
||||||
|
event_session_obj.event_location_list = event_location_result_list
|
||||||
|
elif isinstance(event_location_rec_list_result, list):
|
||||||
|
event_session_obj.event_location_list = []
|
||||||
|
else:
|
||||||
|
event_session_obj.event_location_list = None
|
||||||
|
|
||||||
if inc_event_person_list: pass
|
if inc_event_person_list: pass
|
||||||
|
|
||||||
if inc_event_presentation_list:
|
if inc_event_presentation_list:
|
||||||
|
|||||||
@@ -122,10 +122,13 @@ class Event_Session_Base(BaseModel):
|
|||||||
|
|
||||||
# Including convenience data
|
# Including convenience data
|
||||||
# This is only for convenience. Probably going to keep unless it causes a problem.
|
# This is only for convenience. Probably going to keep unless it causes a problem.
|
||||||
|
# event_code: Optional[str]
|
||||||
event_name: Optional[str]
|
event_name: Optional[str]
|
||||||
event_start_datetime: Optional[datetime.datetime]
|
event_start_datetime: Optional[datetime.datetime]
|
||||||
event_end_datetime: Optional[datetime.datetime]
|
event_end_datetime: Optional[datetime.datetime]
|
||||||
|
# event_location_code: Optional[str]
|
||||||
event_location_name: Optional[str]
|
event_location_name: Optional[str]
|
||||||
|
# event_track_code: Optional[str]
|
||||||
event_track_name: Optional[str]
|
event_track_name: Optional[str]
|
||||||
# location_name: Optional[str] = Field(
|
# location_name: Optional[str] = Field(
|
||||||
# alias = 'event_location_name'
|
# alias = 'event_location_name'
|
||||||
@@ -142,6 +145,7 @@ class Event_Session_Base(BaseModel):
|
|||||||
event_file_list: Optional[list] # Optional[Event_File_Base]
|
event_file_list: Optional[list] # Optional[Event_File_Base]
|
||||||
event_file_internal_use_list: Optional[list] # Optional[Event_File_Base]
|
event_file_internal_use_list: Optional[list] # Optional[Event_File_Base]
|
||||||
event_location: Optional[Union[Event_Location_Base, None]]
|
event_location: Optional[Union[Event_Location_Base, None]]
|
||||||
|
event_location_list: Optional[list[Event_Location_Base]] # Optional[Event_Location_Base]
|
||||||
event_person_list: Optional[list]
|
event_person_list: Optional[list]
|
||||||
event_presenter_cat: Optional[Union[str, None]]
|
event_presenter_cat: Optional[Union[str, None]]
|
||||||
event_presentation_list: Optional[list[Event_Presentation_Base]] # Optional[Event_Presentation_Base]
|
event_presentation_list: Optional[list[Event_Presentation_Base]] # Optional[Event_Presentation_Base]
|
||||||
|
|||||||
@@ -476,6 +476,7 @@ async def get_event_session_obj(
|
|||||||
inc_event_file_list: bool = False,
|
inc_event_file_list: bool = False,
|
||||||
inc_event_file_internal_use_list: bool = False,
|
inc_event_file_internal_use_list: bool = False,
|
||||||
inc_event_location: bool = False,
|
inc_event_location: bool = False,
|
||||||
|
inc_event_location_list: bool = False,
|
||||||
inc_event_person: bool = False, # Under event_presenter
|
inc_event_person: bool = False, # Under event_presenter
|
||||||
inc_event_person_profile: bool = False, # Under event_person
|
inc_event_person_profile: bool = False, # Under event_person
|
||||||
inc_event_person_list: bool = False,
|
inc_event_person_list: bool = False,
|
||||||
@@ -518,6 +519,7 @@ async def get_event_session_obj(
|
|||||||
inc_event_file_list = inc_event_file_list,
|
inc_event_file_list = inc_event_file_list,
|
||||||
inc_event_file_internal_use_list = inc_event_file_internal_use_list,
|
inc_event_file_internal_use_list = inc_event_file_internal_use_list,
|
||||||
inc_event_location = inc_event_location,
|
inc_event_location = inc_event_location,
|
||||||
|
inc_event_location_list = inc_event_location_list,
|
||||||
inc_event_person = inc_event_person,
|
inc_event_person = inc_event_person,
|
||||||
inc_event_person_profile = inc_event_person_profile,
|
inc_event_person_profile = inc_event_person_profile,
|
||||||
inc_event_person_list = inc_event_person_list,
|
inc_event_person_list = inc_event_person_list,
|
||||||
|
|||||||
Reference in New Issue
Block a user