Ejemplo n.º 1
0
class SubContributionForm(IndicoForm):
    title = StringField(_('Title'), [DataRequired()])
    description = TextAreaField(_('Description'))
    duration = IndicoDurationField(
        _('Duration'),
        [DataRequired(), MaxDuration(timedelta(hours=24))],
        default=timedelta(minutes=20))
    speakers = SubContributionPersonLinkListField(
        _('Speakers'),
        allow_submitters=False,
        allow_authors=False,
        description=_('The speakers of the subcontribution'))
    references = ReferencesField(
        _('External IDs'),
        reference_class=SubContributionReference,
        description=_('Manage external resources for this sub-contribution'))
    code = StringField(_('Program code'))

    @generated_data
    def render_mode(self):
        return RenderMode.markdown

    def __init__(self, *args, **kwargs):
        self.event = kwargs.pop('event')
        self.subcontrib = kwargs.pop('subcontrib', None)
        super().__init__(*args, **kwargs)
Ejemplo n.º 2
0
class SubContributionForm(IndicoForm):
    title = StringField(_('Title'), [DataRequired()])
    description = TextAreaField(_('Description'))
    duration = TimeDeltaField(
        _('Duration'),
        [DataRequired(), MaxDuration(timedelta(hours=24))],
        default=timedelta(minutes=20),
        units=('minutes', 'hours'))
    speakers = SubContributionPersonLinkListField(
        _('Speakers'),
        allow_submitters=False,
        description=_('The speakers of the subcontribution'))
    references = ReferencesField(
        _("External IDs"),
        reference_class=SubContributionReference,
        description=_("Manage external resources for this sub-contribution"))

    def __init__(self, *args, **kwargs):
        self.event = kwargs.pop('event')
        self.subcontrib = kwargs.pop('subcontrib', None)
        super(SubContributionForm, self).__init__(*args, **kwargs)