-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathforms.py
34 lines (27 loc) · 872 Bytes
/
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
from flask_wtf import FlaskForm
from wtforms import StringField, PasswordField, TextAreaField
from wtforms.validators import DataRequired, Email, Length, InputRequired
class RegisterForm(FlaskForm):
"""Form for adding Users"""
username = StringField(
"Username",
validators=[InputRequired(), Length(min=1, max=120)],
)
email = StringField(
"Email",
validators=[InputRequired(), Email(), Length(max=50)],
)
password = PasswordField(
"Password",
validators=[InputRequired(), Length(min=6, max=120)],
)
class LoginForm(FlaskForm):
"""Login Form"""
username = StringField(
"Username",
validators=[InputRequired(), Length(min=1, max=120)],
)
password = PasswordField(
"Password",
validators=[InputRequired(), Length(min=6, max=120)],
)