-
Notifications
You must be signed in to change notification settings - Fork 0
/
forms.py
20 lines (17 loc) · 1.21 KB
/
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 Form
from wtforms import StringField,PasswordField,SubmitField
from wtforms.validators import DataRequired, Email, Length
#backend
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="Passwords must be 6 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."), Length(min=6, message="Passwords must be 6 characters or more.")])
submit = SubmitField('Log in')
class AddressForm(Form):
address = StringField('Address',validators =[DataRequired("Please enter your email address.")])
submit = SubmitField('search')