-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathforms.py
40 lines (31 loc) · 1.06 KB
/
forms.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# -*- coding: utf-8 -*-
from __future__ import print_function, division, absolute_import, unicode_literals
from flask_wtf import Form
from wtforms import StringField, PasswordField
from wtforms.validators import DataRequired, EqualTo, Length
class SeedForm(Form):
seed = PasswordField('seed', [DataRequired()])
class RegisterForm(Form):
name = StringField(
'Username', validators=[DataRequired(), Length(min=6, max=25)]
)
email = StringField(
'Email', validators=[DataRequired(), Length(min=6, max=40)]
)
password = PasswordField(
'Password', validators=[DataRequired(), Length(min=6, max=40)]
)
confirm = PasswordField(
'Repeat Password',
[
DataRequired(),
EqualTo('password', message='Passwords must match')
]
)
class LoginForm(Form):
name = StringField('Username', [DataRequired()])
password = PasswordField('Password', [DataRequired()])
class ForgotForm(Form):
email = StringField(
'Email', validators=[DataRequired(), Length(min=6, max=40)]
)