class ProfileForm(Form): password = PasswordField('New Password', validators=[ Optional(), Length(min=8, max=80), EqualTo('confirm', message='Passwords must match') ]) confirm = PasswordField('Repeat Password') default_ipv4_mask = IntegerField( label='IPv4 Mask', validators=[ Optional(), NumberRange(min=0, max=32, message='IPv4 Mask must between %(min)s and %(max)s'), ]) default_ipv6_mask = IntegerField( label='IPv6 Mask', validators=[ Optional(), NumberRange(min=0, max=128, message='IPv6 Mask must between %(min)s and %(max)s'), ]) timezone = QuerySelectField(get_label='name', allow_blank=True) submit = SubmitField('Update Profile')
class EnrollmentForm(Form): audit = QuerySelectField('Audit') # subjects = TextField("Subjects") subject_de = BooleanField(u"Deutsch") subject_en = BooleanField(u"Englisch") subject_ru = BooleanField(u"Russisch") subject_fr = BooleanField(u"Französisch") subject_es = BooleanField(u"Spanisch") subject_hidden = HiddenField(u"Sprachauswahl", validators=[validate_enrollment_subjects])
class AuditForm(Form): active = BooleanField() # event = QuerySelectField('Event', query_factory=lambda: Event.query.all()) location = QuerySelectField('Location', query_factory=lambda: Location.query.all()) starts = DateTimeField('Starts', validators=[Required()], format='%d.%m.%Y %H:%M:%S') ends = DateTimeField('Ends', validators=[Required()], format='%d.%m.%Y %H:%M:%S')
class RegisterForm(Form): email = TextField('Email Address', validators = [Email()]) password = PasswordField('New Password', validators=[ Required(), Length(min=8, max=80), EqualTo('confirm', message='Passwords must match') ]) confirm = PasswordField('Repeat Password') accept_tos = BooleanField('I accept the TOS', validators = [Required()]) timezone = QuerySelectField(get_label='name', allow_blank=True) submit = SubmitField('Register')