-
Notifications
You must be signed in to change notification settings - Fork 0
/
forms.py
19 lines (16 loc) · 1.1 KB
/
forms.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
from flask_wtf import Form
from wtforms import StringField, PasswordField, SubmitField
from wtforms.validators import DataRequired, Email, Length
class SignupForm(Form):
first_name = StringField("First name", validators=[DataRequired("Please enter your first name")])
last_name = StringField("Last name", validators=[DataRequired("Please enter your last name")])
email = StringField("Email", validators=[DataRequired("Please enter your email address"), Email("Please enter a valid email address")])
password = PasswordField("Password", validators=[DataRequired("Please enter a password"), Length(min=6, message="Password must be six characters or more")])
submit = SubmitField("Sign up")
class LoginForm(Form):
email = StringField('Email', validators=[DataRequired("Please enter your email address"), Email("Please enter your email address")])
password = PasswordField("Password", validators=[DataRequired("Please enter a password")])
submit = SubmitField("Sign In")
class AddressForm(Form):
address = StringField('Address', validators=[DataRequired("Please enter your address")])
submit = SubmitField("Search")