class EventPersonsForm(IndicoForm): person_link_data = EventPersonLinkListField(_('Chairpersons')) def __init__(self, *args, **kwargs): self.event = kwargs.pop('event') super(EventPersonsForm, self).__init__(*args, **kwargs) if self.event.type_ == EventType.lecture: self.person_link_data.label.text = _('Speakers')
class LectureCreationForm(EventCreationFormBase): _field_order = ('title', 'occurrences', 'timezone', 'location_data', 'person_link_data', 'protection_mode') _advanced_field_order = ('description', 'theme') occurrences = OccurrencesField(_("Dates"), [DataRequired()], default_time=time(8), default_duration=timedelta(minutes=90)) person_link_data = EventPersonLinkListField(_('Speakers')) description = TextAreaField(_('Description'), widget=CKEditorWidget()) theme = IndicoThemeSelectField(_('Theme'), event_type=EventType.lecture, allow_default=True)
class MockForm(IndicoForm): person_link_data = EventPersonLinkListField('Test') def __init__(self, *args, **kwargs): self.event = kwargs.pop('event') super().__init__(*args, **kwargs)