summaryrefslogtreecommitdiffstats
path: root/forms.py
blob: 5a86e6edd47dbddfc3a7ce86d04605f45ec3dd75 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
from flask_wtf import FlaskForm
from wtforms import StringField, PasswordField, SubmitField, RadioField
from wtforms.validators import DataRequired, Length, EqualTo, Email

class OptionForm(FlaskForm):
    option = RadioField('Label', choices=[('mail-old','I want to use an existing email address.'),('mail-new','I want to create and use a new email address.')])
    submit = SubmitField('Save preference')

class RegistrationForm(FlaskForm):
    username = StringField('Username', validators=[DataRequired(), Length(min=1, max=32)])
    email = StringField('Email', validators=[DataRequired(), Email()])
    password = PasswordField('Password', validators=[DataRequired()])
    confirm_password = PasswordField('Confirm Password', validators=[DataRequired(), EqualTo('password')])
    submit = SubmitField('Register')

#class VerificationForm(FlaskForm):
#    username = StringField('Username', validators=[DataRequired(), Length(min=1, max=32)])
#    verif_code = StringField('Verification Code', validators=[DataRequired()])
#    submit = SubmitField('Verify')