示例#1
0
class EventForm(DateForm):
    name = StringField(_('name'), [InputRequired()],
                       render_kw={'autofocus': True})
    event = TableField(_('sub event of'))
    place = TableField(_('location'))
    place_from = TableField(_('from'))
    place_to = TableField(_('to'))
    object = TableMultiField()
    person = TableMultiField()
    event_id = HiddenField()
    description = TextAreaField(_('description'))
    save = SubmitField(_('insert'))
    insert_and_continue = SubmitField(_('insert and continue'))
    continue_ = HiddenField()
    opened = HiddenField()
    given_place = TableMultiField(_('given place'))

    def validate(self) -> bool:
        """ Check if selected super event is allowed."""
        # Todo: also check if super is not a sub event of itself (recursively)
        valid = DateForm.validate(self)
        if self.event.data:
            if str(self.event.data) == str(self.event_id.data):
                self.event.errors.append(_('error node self as super'))
                valid = False
        return valid
示例#2
0
class ActorForm(DateForm):
    name = StringField(_('name'), [DataRequired()])
    alias = FieldList(StringField(''), description=_('tooltip alias'))
    residence = TableField(_('residence'))
    appears_first = TableField(_('appears first'))
    appears_last = TableField(_('appears last'))
    description = TextAreaField(_('description'))
    save = SubmitField(_('insert'))
    insert_and_continue = SubmitField(_('insert and continue'))
    continue_ = HiddenField()
    opened = HiddenField()
示例#3
0
class ActorForm(DateForm):
    name = StringField(_('name'), [InputRequired()],
                       render_kw={'autofocus': True})
    alias = FieldList(StringField(''), description=_('tooltip alias'))
    residence = TableField(_('residence'))
    begins_in = TableField()
    ends_in = TableField()
    description = TextAreaField(_('description'))
    save = SubmitField(_('insert'))
    insert_and_continue = SubmitField(_('insert and continue'))
    continue_ = HiddenField()
    opened = HiddenField()
示例#4
0
class EventForm(DateForm):
    name = StringField(_('name'), [DataRequired()])
    event = TableField(_('sub event of'))
    place = TableField(_('location'))
    event_id = HiddenField()
    description = TextAreaField(_('description'))
    save = SubmitField(_('insert'))
    insert_and_continue = SubmitField(_('insert and continue'))
    continue_ = HiddenField()
    opened = HiddenField()
    given_place = TableMultiField(_('given place'))

    def validate(self, extra_validators=None):
        """ Check if selected super event is allowed"""
        # Todo: also check if super is not a sub event of itself (recursively)
        valid = DateForm.validate(self)
        if self.event.data:
            if str(self.event.data) == str(self.event_id.data):
                self.event.errors.append(_('error node self as super'))
                valid = False
        return valid
示例#5
0
class LogoForm(Form):
    file = TableField(_('file'), [InputRequired()])
    save = SubmitField(uc_first(_('change logo')))
示例#6
0
class AddFileForm(Form):
    file = TableField(_('file'), [InputRequired()])
    page = StringField(_('page'))
    save = SubmitField(_('insert'))
示例#7
0
class AddPlaceForm(Form):
    place = TableField(_('place'), [InputRequired()])
    page = StringField(_('page'))
    save = SubmitField(_('insert'))
示例#8
0
class AddActorForm(Form):
    actor = TableField(_('actor'), [InputRequired()])
    page = StringField(_('page'))
    save = SubmitField(_('insert'))
示例#9
0
class AddEventForm(Form):
    event = TableField(_('event'), [InputRequired()])
    page = StringField(_('page'))
    save = SubmitField(_('insert'))
示例#10
0
class AddReferenceForm(Form):
    reference = TableField(_('reference'), [InputRequired()])
    page = StringField(_('page'))
    save = SubmitField(_('insert'))
示例#11
0
class AddFileForm(Form):
    file = TableField(_('file'))
    page = StringField(_('page'))
    save = SubmitField(_('insert'))
示例#12
0
class AddPlaceForm(Form):
    place = TableField(_('place'))
    page = StringField(_('page'))
    save = SubmitField(_('insert'))
示例#13
0
class AddActorForm(Form):
    actor = TableField(_('actor'))
    page = StringField(_('page'))
    save = SubmitField(_('insert'))
示例#14
0
class AddEventForm(Form):
    event = TableField(_('event'))
    page = StringField(_('page'))
    save = SubmitField(_('insert'))
示例#15
0
class AddSourceForm(Form):
    source = TableField(_('source'))
    page = StringField(_('page'))
    save = SubmitField(_('insert'))
示例#16
0
class AddReferenceForm(Form):
    reference = TableField(_('reference'))
    page = StringField(_('page'))
    save = SubmitField(_('insert'))