-
Notifications
You must be signed in to change notification settings - Fork 0
/
forms.py
18 lines (15 loc) · 962 Bytes
/
forms.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
from flask_wtf import FlaskForm
from wtforms import StringField, PasswordField
from wtforms.validators import InputRequired, Length, Email
class RegisterUserForm(FlaskForm):
username = StringField("Username", validators=[InputRequired(), Length(max=20)])
password = PasswordField('Password', validators=[InputRequired()])
email = StringField('Email', validators=[InputRequired(), Email(), Length(max=50)])
first_name = StringField('First Name', validators=[InputRequired(), Length(max=30)])
last_name = StringField('Last Name', validators=[InputRequired(), Length(max=30)])
class LoginUserForm(FlaskForm):
username = StringField("Username", validators=[InputRequired(), Length(max=20)])
password = PasswordField('Password', validators=[InputRequired()])
class FeedbackForm(FlaskForm):
title = StringField("Title", validators=[InputRequired(), Length(max=100)])
content = StringField("Content", validators=[InputRequired()])