def save_custom_forms(data, event_id): custom_forms = DataGetter.get_custom_form_elements(event_id) if not custom_forms: custom_forms = CustomForms(event_id=event_id) custom_forms.session_form = json.dumps(data['session']) custom_forms.speaker_form = json.dumps(data['speaker']) save_to_db(custom_forms)
def get_custom_form(event_id=1): return CustomForms(event_id=event_id, session_form=session_form_str, speaker_form=speaker_form_str)