Working on stuff related to session proposals. Again... I think it all works now.
This commit is contained in:
@@ -11,7 +11,8 @@ from app.models.common_field_schema import base_fields, default_num_bytes
|
||||
# from app.models.event_models import Event_Base
|
||||
# from app.models.event_abstract_models import Event_Abstract_Base # This creates an import loop
|
||||
from app.models.event_person_models import Event_Person_Base
|
||||
from app.models.event_session_models import Event_Session_Base
|
||||
from app.models.event_presenter_models import Event_Presenter_Base
|
||||
# from app.models.event_session_models import Event_Session_Base
|
||||
from app.models.person_models import Person_Base
|
||||
|
||||
|
||||
@@ -81,8 +82,9 @@ class Event_Presentation_Base(BaseModel):
|
||||
#event_device_list: Optional[list] # Optional[Event_Device_Base]
|
||||
event_file_list: Optional[list] # Optional[Event_File_Base]
|
||||
#event_location: Optional[Event_Location_Base]
|
||||
event_presenter_list: Optional[list] # Optional[Event_Presenter_Base]
|
||||
event_session: Optional[Event_Session_Base]
|
||||
event_presenter_list: Optional[list[Event_Presenter_Base]] # Optional[Event_Presenter_Base]
|
||||
# event_session: Optional[Event_Session_Base]
|
||||
event_session: Optional[dict]
|
||||
#event_track: Optional[Event_Track_Base]
|
||||
|
||||
_processed_at: datetime.datetime = PrivateAttr(default_factory=datetime.datetime.now)
|
||||
|
||||
@@ -9,10 +9,10 @@ from app.lib_general import log, logging
|
||||
|
||||
from app.models.common_field_schema import base_fields, default_num_bytes
|
||||
# from app.models.event_models import Event_Base
|
||||
from app.models.event_abstract_models import Event_Abstract_Base
|
||||
# from app.models.event_abstract_models import Event_Abstract_Base
|
||||
from app.models.event_person_models import Event_Person_Base
|
||||
from app.models.event_presentation_models import Event_Presentation_Base
|
||||
from app.models.event_session_models import Event_Session_Base
|
||||
# from app.models.event_presentation_models import Event_Presentation_Base
|
||||
# from app.models.event_session_models import Event_Session_Base
|
||||
# from app.models.person_models import Person_Base
|
||||
# from app.models.user_models import User_Base
|
||||
|
||||
@@ -31,18 +31,25 @@ class Event_Presenter_Base(BaseModel):
|
||||
)
|
||||
event_id_random: Optional[str]
|
||||
event_id: Optional[int]
|
||||
|
||||
event_abstract_id_random: Optional[str]
|
||||
event_abstract_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]
|
||||
|
||||
event_presentation_id_random: Optional[str]
|
||||
event_presentation_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]
|
||||
|
||||
person_id_random: Optional[str]
|
||||
person_id: Optional[int]
|
||||
|
||||
@@ -95,14 +102,17 @@ class Event_Presenter_Base(BaseModel):
|
||||
|
||||
# Including other related objects
|
||||
# event: Optional[Event_Base]
|
||||
event_abstract: Optional[Event_Abstract_Base]
|
||||
# event_abstract: Optional[Event_Abstract_Base]
|
||||
event_abstract: Optional[dict]
|
||||
event_abstract_list: Optional[list] # Optional[Event_Abstract_Base] Is more than one abstract allowed per presenter?
|
||||
# event_device_list: Optional[list] # Optional[Event_Device_Base]
|
||||
event_file_list: Optional[list] # Optional[Event_File_Base]
|
||||
# event_location: Optional[Event_Location_Base]
|
||||
event_person: Optional[Event_Person_Base]
|
||||
event_presentation: Optional[Event_Presentation_Base]
|
||||
event_session: Optional[Event_Session_Base]
|
||||
# event_presentation: Optional[Event_Presentation_Base]
|
||||
event_presentation: Optional[dict]
|
||||
# event_session: Optional[Event_Session_Base]
|
||||
event_session: Optional[dict]
|
||||
# event_track: Optional[Event_Track_Base]
|
||||
# person: Optional[Person_Base] # This is under event_person
|
||||
# user: Optional[User_Base] # This is under event_person
|
||||
@@ -155,6 +165,15 @@ class Event_Presenter_Base(BaseModel):
|
||||
return redis_lookup_id_random(record_id_random=values['event_session_id_random'], table_name='event_session')
|
||||
return None
|
||||
|
||||
@validator('event_presentation_id', always=True)
|
||||
def event_presentation_id_lookup(cls, v, values, **kwargs):
|
||||
log.setLevel(logging.WARNING)
|
||||
log.debug(locals())
|
||||
|
||||
if values['event_presentation_id_random']:
|
||||
return redis_lookup_id_random(record_id_random=values['event_presentation_id_random'], table_name='event_presentation')
|
||||
return None
|
||||
|
||||
class Config:
|
||||
underscore_attrs_are_private = True
|
||||
allow_population_by_field_name = True
|
||||
|
||||
@@ -11,6 +11,7 @@ from app.models.common_field_schema import base_fields, default_num_bytes
|
||||
# from app.models.event_models import Event_Base
|
||||
from app.models.event_location_models import Event_Location_Base
|
||||
from app.models.event_person_models import Event_Person_Base # NOTE: Using this will probably create an import loop
|
||||
from app.models.event_presentation_models import Event_Presentation_Base
|
||||
from app.models.event_track_models import Event_Track_Base
|
||||
from app.models.person_models import Person_Base
|
||||
|
||||
@@ -98,7 +99,7 @@ class Event_Session_Base(BaseModel):
|
||||
event_location: Optional[Union[Event_Location_Base, None]]
|
||||
event_person_list: Optional[list]
|
||||
event_presenter_cat: Optional[Union[str, None]]
|
||||
event_presentation_list: Optional[list] # Optional[Event_Presentation_Base]
|
||||
event_presentation_list: Optional[list[Event_Presentation_Base]] # Optional[Event_Presentation_Base]
|
||||
event_presenter_list: Optional[list] # Optional[Event_Presenter_Base]
|
||||
event_track: Optional[Event_Track_Base]
|
||||
poc_event_person: Optional[Event_Person_Base] # NOTE: Using thi will probably create an import loop
|
||||
|
||||
Reference in New Issue
Block a user