-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathforms.py
48 lines (36 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
41
42
43
44
45
46
47
48
"""Forms for Recipe App."""
from wtforms import StringField, PasswordField
from wtforms.validators import InputRequired, Length, Email
from flask_wtf import FlaskForm
class RegisterForm(FlaskForm):
""""User registration form"""
username = StringField(
"Username",
validators=[InputRequired(), Length(min=6, max=20)],
)
password = StringField(
"Password",
validators=[InputRequired(), Length(min=6, max=20)],
)
email = StringField(
"Email",
validators=[InputRequired(), Email(), Length(max=50)],
)
first_name = StringField(
"First Name",
validators=[InputRequired(), Length(min=1, max=30)],
)
last_name = StringField(
"Last Name",
validators=[InputRequired(), Length(min=1, max=30)],
)
class LoginForm(FlaskForm):
"""Login form."""
username = StringField(
"Username",
validators=[InputRequired(), Length(min=6, max=20)],
)
password = PasswordField(
"Password",
validators=[InputRequired(), Length(min=6, max=20)],
)