-
Notifications
You must be signed in to change notification settings - Fork 0
/
forms.py
26 lines (22 loc) · 1.35 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
from flask_wtf import Form
from wtforms import PasswordField
from wtforms import TextField
from wtforms import HiddenField
from wtforms import SubmitField
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 at least 8 characters")])
password2 = PasswordField('password2', validators=[validators.DataRequired(), validators.EqualTo('password', message='Passwords 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()])
class DeleteTableForm(Form):
tablenumber = HiddenField('tablenumber')
submit = SubmitField('submit', [validators.DataRequired()])