-
Notifications
You must be signed in to change notification settings - Fork 0
/
forms.py
20 lines (20 loc) · 980 Bytes
/
forms.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
from flask_wtf import FlaskForm
from wtforms import StringField, PasswordField, BooleanField, SubmitField
from wtforms.validators import DataRequired, Length , Email, EqualTo
class LoginForm(FlaskForm):
email = StringField('email',validators=[DataRequired(),Email()])
password = PasswordField('password',validators=[DataRequired()])
remember = BooleanField('Remember me')
submit = SubmitField('login')
class RegistrationForm(FlaskForm):
username= StringField('Username',validators=[DataRequired(),Length(min=2,max=20)])
email = StringField('email',validators=[DataRequired(),Email()])
password = PasswordField('password',validators=[DataRequired()])
confirm_password = PasswordField('confirm_password',validators=[DataRequired(),EqualTo('password')])
submit = SubmitField('Sign Up')
class AboutForm(FlaskForm):
submit= SubmitField('About')
class LogoutForm(FlaskForm):
submit = SubmitField('log out')
class HomeForm(FlaskForm):
submit = SubmitField('home')