-
Notifications
You must be signed in to change notification settings - Fork 0
/
forms.py
21 lines (16 loc) · 1.02 KB
/
forms.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
""" Forms for food planner app. """
from flask_wtf import FlaskForm
from wtforms import StringField, PasswordField
from flask_wtf.html5 import URLField, EmailField
from wtforms.validators import InputRequired, Email, Optional, EqualTo
class SignUpForm(FlaskForm):
"""Form for adding user."""
username = StringField("Username", validators=[InputRequired(message="Please add Username")])
email = EmailField("Email", validators=[InputRequired(message="Email required"), Email(message="Invalid !")])
password = PasswordField("Password", validators=[InputRequired(message="Please create a Password")])
confirm = PasswordField("Confirm Password", validators=[InputRequired(message="Please input the same Password")])
img_url = URLField("URL(Optional)", validators=[Optional()])
class LoginForm(FlaskForm):
""" Login form."""
username = StringField("Username", validators=[InputRequired(message="Username Required")])
password = PasswordField("Password", validators=[InputRequired(message="Password Required")])