-
Notifications
You must be signed in to change notification settings - Fork 0
/
forms.py
20 lines (17 loc) · 1014 Bytes
/
forms.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
from flask_wtf import FlaskForm
from wtforms import StringField, PasswordField, TextAreaField
from wtforms.validators import InputRequired, Email, Length
class RegisterForm(FlaskForm):
"""Form for registering user."""
email = StringField("Email", validators=[InputRequired(), Email(), Length(max=254)])
password = PasswordField("Password", validators=[InputRequired()])
firstname = StringField("First Name", validators=[InputRequired(), Length(max=50)])
lastname = StringField("Last Name", validators=[InputRequired(), Length(max=50)])
class LoginForm(FlaskForm):
"""Form to login user."""
email = StringField("Email", validators=[InputRequired(), Email(), Length(max=254)])
password = PasswordField("Password", validators=[InputRequired()])
class UserEditForm(FlaskForm):
"""Form for editing user."""
firstname = StringField("First Name", validators=[InputRequired(), Length(max=50)])
lastname = StringField("Last Name", validators=[InputRequired(), Length(max=50)])