def create_meeting(self, dossier, committee_oguid): dm = getUtility(IWizardDataStorage) data = dm.get_data(get_dm_key()) data['dossier_oguid'] = Oguid.for_object(dossier) meeting = Meeting(**data) meeting.initialize_participants() session = create_session() session.add(meeting) session.flush() # required to create an autoincremented id dm.drop_data(get_dm_key()) return meeting
def create_meeting(self, dossier, committee_oguid): dm = getUtility(IWizardDataStorage) data = dm.get_data(get_dm_key()) data['dossier_oguid'] = Oguid.for_object(dossier) meeting_template_uid = data.pop('meeting_template', None) meeting = Meeting(**data) if meeting_template_uid is not None: meeting_template = api.content.get( UID=meeting_template_uid) meeting_template.apply(meeting) meeting.initialize_participants() session = create_session() session.add(meeting) session.flush() # required to create an autoincremented id dm.drop_data(get_dm_key()) return meeting