Code clean up. Better debugging. Work on event session, presentation, and presenter.

This commit is contained in:
Scott Idem
2021-09-29 14:18:34 -04:00
parent b2c70c0c87
commit be788fc5e6
10 changed files with 253 additions and 159 deletions

View File

@@ -25,10 +25,6 @@ def load_event_presentation_obj(
enabled: str = 'enabled', # enabled, disabled, all
hidden: str = 'not_hidden', # hidden, not_hidden, all
inc_file_count: bool = False, # NOTE: file counts are from separate views
limit: int = 1000,
by_alias: bool = True,
exclude_unset: bool = True,
model_as_dict: bool = False,
event_file_file_purpose_id: int = None,
event_file_file_purpose: str = None,
event_file_priority: bool = None,
@@ -49,6 +45,10 @@ def load_event_presentation_obj(
inc_event_session: bool = False,
inc_person: bool = False,
inc_user: bool = False,
limit: int = 1000,
by_alias: bool = True,
exclude_unset: bool = True,
model_as_dict: bool = False,
) -> Event_Presentation_Base|bool:
log.setLevel(logging.WARNING) # DEBUG, INFO, WARNING, ERROR, EXCEPTION, CRITICAL
log.debug(locals())
@@ -75,9 +75,6 @@ def load_event_presentation_obj(
log.error(e.json())
return False
# event_presentation_obj = Event_Presentation_Base(**event_presentation_rec)
# log.debug(event_presentation_obj)
# account_id = event_presentation_rec.get('account_id', None)
event_id = event_presentation_rec.get('event_id', None)
event_abstract_id = event_presentation_rec.get('event_abstract_id', None)
@@ -99,11 +96,11 @@ def load_event_presentation_obj(
if hidden in ['hidden', 'not_hidden', 'all']:
if hidden == 'hidden':
data['hidden'] = True
sql_hidden = f'AND `event_presenter`.hidden = :hidden'
data['hide'] = True
sql_hidden = f'AND `event_presenter`.hide = :hide'
elif hidden == 'not_hidden':
data['hidden'] = False
sql_hidden = f'AND `event_presenter`.hidden = :hidden'
data['hide'] = False
sql_hidden = f'AND `event_presenter`.hide = :hide'
elif hidden == 'all':
sql_hidden = ''