-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathforms.py
42 lines (36 loc) · 1.31 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
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 your email address")])
password = PasswordField(
'Password',
validators=[
DataRequired("Please enter a password"),
Length(min=6, message="Password must be 6 chars 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 an address")])
submit = SubmitField("Search")