-
Notifications
You must be signed in to change notification settings - Fork 0
/
forms.py
24 lines (18 loc) · 1.18 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
from flask_wtf import Form
from wtforms import PasswordField
from wtforms import SubmitField
from wtforms import TextField
from wtforms.fields.html5 import EmailField
from wtforms import validators
class RegistrationForm(Form):
email = EmailField('email', validators=[validators.DataRequired(), validators.Email()])
password = PasswordField('password', validators=[validators.DataRequired(), validators.Length(min=8, message="Please choose a password of atleast 8 characters")])
password2 = PasswordField('password2', validators=[validators.DataRequired(), validators.EqualTo('password', message='Password and confirm password fields must match')])
submit = SubmitField('submit', [validators.DataRequired()])
class LoginForm(Form):
loginemail = EmailField('email', validators=[validators.DataRequired(), validators.Email()])
loginpassword = PasswordField('password', validators=[validators.DataRequired(message="Password field is required")])
submit = SubmitField('submit', [validators.DataRequired()])
class CreateTableForm(Form):
tablenumber = TextField('tablenumber', validators=[validators.DataRequired()])
submit = SubmitField('createtablesubmit', validators=[validators.DataRequired()])