-
Notifications
You must be signed in to change notification settings - Fork 0
/
forms.py
30 lines (15 loc) · 961 Bytes
/
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
27
from flask_wtf import FlaskForm
from wtforms import StringField, PasswordField, TextAreaField
from wtforms.validators import InputRequired, Length
class UserLogin(FlaskForm):
username = StringField('Username', validators=[InputRequired()])
password = PasswordField('Password', validators=[InputRequired()])
class UserRegistration(FlaskForm):
first_name = StringField('First Name', validators=[InputRequired(), Length(max=30)])
last_name = StringField('Last Name', validators=[InputRequired(), Length(max=30)])
email = StringField('Email', validators=[InputRequired(), Length(max=50)])
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 = TextAreaField('Feedback', validators=[InputRequired()])