Code clean up. Better debugging
This commit is contained in:
@@ -183,6 +183,7 @@ def get_event_file_rec_list(
|
||||
ORDER BY `event_file`.created_on DESC, `event_file`.updated_on DESC
|
||||
{sql_limit};
|
||||
"""
|
||||
log.debug(sql)
|
||||
|
||||
if event_file_rec_li_result := sql_select(data=data, sql=sql, as_list=True):
|
||||
|
||||
|
||||
@@ -39,14 +39,14 @@ class Event_Presentation_Base(BaseModel):
|
||||
event_abstract_id_random: Optional[str]
|
||||
event_abstract_id: Optional[int]
|
||||
|
||||
#event_location_id_random: Optional[str]
|
||||
#event_location_id: Optional[int]
|
||||
event_location_id_random: Optional[str]
|
||||
event_location_id: Optional[int]
|
||||
|
||||
event_session_id_random: Optional[str]
|
||||
event_session_id: Optional[int]
|
||||
|
||||
#event_track_id_random: Optional[str]
|
||||
#event_track_id: Optional[int]
|
||||
event_track_id_random: Optional[str]
|
||||
event_track_id: Optional[int]
|
||||
|
||||
poc_event_person: Optional[Event_Person_Base]
|
||||
poc_person: Optional[Person_Base]
|
||||
@@ -79,6 +79,17 @@ class Event_Presentation_Base(BaseModel):
|
||||
created_on: Optional[datetime.datetime] = None
|
||||
updated_on: Optional[datetime.datetime] = None
|
||||
|
||||
# Including convenience data
|
||||
# This is only for convenience. Probably going to keep unless it causes a problem.
|
||||
event_name: Optional[str]
|
||||
event_start_datetime: Optional[datetime.datetime]
|
||||
event_end_datetime: Optional[datetime.datetime]
|
||||
event_location_name: Optional[str]
|
||||
event_session_name: Optional[str]
|
||||
event_session_start_datetime: Optional[datetime.datetime]
|
||||
event_session_end_datetime: Optional[datetime.datetime]
|
||||
event_track_name: Optional[str]
|
||||
|
||||
# Including other related objects
|
||||
#event: Optional[Event_Base]
|
||||
#event_abstract: Optional[Event_Abstract_Base] # This creates an import loop
|
||||
|
||||
@@ -43,8 +43,8 @@ class Event_Presenter_Base(BaseModel):
|
||||
# event_abstract_id_random: Optional[str]
|
||||
# event_abstract_id: Optional[int]
|
||||
|
||||
#event_location_id_random: Optional[str]
|
||||
#event_location_id: Optional[int]
|
||||
event_location_id_random: Optional[str]
|
||||
event_location_id: Optional[int]
|
||||
|
||||
event_person_id_random: Optional[str]
|
||||
event_person_id: Optional[int]
|
||||
@@ -55,8 +55,8 @@ class Event_Presenter_Base(BaseModel):
|
||||
event_session_id_random: Optional[str]
|
||||
event_session_id: Optional[int]
|
||||
|
||||
#event_track_id_random: Optional[str]
|
||||
#event_track_id: Optional[int]
|
||||
event_track_id_random: Optional[str]
|
||||
event_track_id: Optional[int]
|
||||
|
||||
# person_id_random: Optional[str]
|
||||
# person_id: Optional[int]
|
||||
@@ -119,6 +119,20 @@ class Event_Presenter_Base(BaseModel):
|
||||
created_on: Optional[datetime.datetime] = None
|
||||
updated_on: Optional[datetime.datetime] = None
|
||||
|
||||
# Including convenience data
|
||||
# This is only for convenience. Probably going to keep unless it causes a problem.
|
||||
event_name: Optional[str]
|
||||
event_start_datetime: Optional[datetime.datetime]
|
||||
event_end_datetime: Optional[datetime.datetime]
|
||||
event_location_name: Optional[str]
|
||||
event_presentation_name: Optional[str]
|
||||
event_presentation_start_datetime: Optional[datetime.datetime]
|
||||
event_presentation_end_datetime: Optional[datetime.datetime]
|
||||
event_session_name: Optional[str]
|
||||
event_session_start_datetime: Optional[datetime.datetime]
|
||||
event_session_end_datetime: Optional[datetime.datetime]
|
||||
event_track_name: Optional[str]
|
||||
|
||||
# Including other related objects
|
||||
# event: Optional[Event_Base]
|
||||
# event_abstract: Optional[Event_Abstract_Base]
|
||||
|
||||
@@ -105,13 +105,17 @@ class Event_Session_Base(BaseModel):
|
||||
|
||||
# Including convenience data
|
||||
# This is only for convenience. Probably going to keep unless it causes a problem.
|
||||
location_name: Optional[str] = Field(
|
||||
alias = 'event_location_name'
|
||||
)
|
||||
track_name: Optional[str] = Field(
|
||||
alias = 'event_track_name'
|
||||
)
|
||||
# Maybe add xxx in the future?
|
||||
event_name: Optional[str]
|
||||
event_start_datetime: Optional[datetime.datetime]
|
||||
event_end_datetime: Optional[datetime.datetime]
|
||||
event_location_name: Optional[str]
|
||||
event_track_name: Optional[str]
|
||||
# location_name: Optional[str] = Field(
|
||||
# alias = 'event_location_name'
|
||||
# )
|
||||
# track_name: Optional[str] = Field(
|
||||
# alias = 'event_track_name'
|
||||
# )
|
||||
|
||||
# Including other related objects
|
||||
# event: Optional[Event_Base]
|
||||
|
||||
@@ -236,6 +236,8 @@ async def get_event_presenter_obj_li(
|
||||
async def get_event_presenter_obj(
|
||||
event_presenter_id: str = Query(..., min_length=1, max_length=22),
|
||||
enabled: str = 'enabled', # enabled, disabled, all; For now this covers any included objects or object lists
|
||||
hidden: str = 'not_hidden', # hidden, not_hidden, all
|
||||
inc_file_count: bool = False,
|
||||
limit: int = 500, # For now this covers any included objects or object lists
|
||||
inc_address: bool = False, # Under contact
|
||||
inc_contact: bool = False, # Under person
|
||||
@@ -258,7 +260,7 @@ async def get_event_presenter_obj(
|
||||
exclude_unset: Optional[bool] = True,
|
||||
response: Response = Response,
|
||||
):
|
||||
log.setLevel(logging.WARNING) # DEBUG, INFO, WARNING, ERROR, EXCEPTION, CRITICAL
|
||||
log.setLevel(logging.DEBUG) # DEBUG, INFO, WARNING, ERROR, EXCEPTION, CRITICAL
|
||||
log.debug(locals())
|
||||
|
||||
if event_presenter_id := redis_lookup_id_random(record_id_random=event_presenter_id, table_name='event_presenter'): pass
|
||||
@@ -268,7 +270,8 @@ async def get_event_presenter_obj(
|
||||
if event_presenter_obj := load_event_presenter_obj(
|
||||
event_presenter_id = event_presenter_id,
|
||||
enabled = enabled,
|
||||
limit = limit,
|
||||
hidden = hidden,
|
||||
inc_file_count = inc_file_count,
|
||||
inc_address = inc_address,
|
||||
inc_contact = inc_contact,
|
||||
inc_event_abstract_list = inc_event_abstract_list,
|
||||
@@ -282,6 +285,7 @@ async def get_event_presenter_obj(
|
||||
inc_event_session = inc_event_session,
|
||||
inc_person = inc_person,
|
||||
inc_user = inc_user,
|
||||
limit = limit,
|
||||
):
|
||||
event_presenter_dict = event_presenter_obj.dict(by_alias=by_alias, exclude_unset=exclude_unset)
|
||||
pass
|
||||
|
||||
Reference in New Issue
Block a user