class MeetingSessionBlockForm(IndicoForm): session_title = StringField(_('Title'), [DataRequired()], description=_('Title of the session')) block_title = StringField(_('Block title'), description=_('Title of the session block')) block_person_links = SessionBlockPersonLinkListField(_('Conveners')) block_location_data = IndicoLocationField(_('Location')) def __init__(self, *args, **kwargs): self.event = kwargs.pop('event') self.session_block = kwargs.pop('session_block', None) super(MeetingSessionBlockForm, self).__init__(*args, **kwargs) @property def session_fields(self): return [ field_name for field_name in self._fields if field_name.startswith('session_') ] @property def block_fields(self): return [ field_name for field_name in self._fields if field_name.startswith('block_') ]
class SessionBlockForm(IndicoForm): title = StringField(_('Title'), description=_('Title of the session block')) person_links = SessionBlockPersonLinkListField(_('Conveners')) location_data = IndicoLocationField(_('Location')) def __init__(self, *args, **kwargs): self.session_block = kwargs.pop('session_block', None) super(SessionBlockForm, self).__init__(*args, **kwargs)