-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathforms.py
18 lines (14 loc) · 824 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, BooleanField, SubmitField
from wtforms.validators import Email, DataRequired, Length, EqualTo
class LoginForm(FlaskForm):
email = StringField('Email: ', validators=[Email()])
psw = PasswordField('Password: ', validators=[DataRequired(), Length(min=4, max=100)])
remember = BooleanField('Remember', default=False)
submit = SubmitField('Log in')
class RegisterForm(FlaskForm):
name = StringField('Name: ', validators=[Length(min=4, max=100)])
email = StringField('Email: ', validators=[Email()])
psw = PasswordField('Password: ', validators=[DataRequired(), Length(min=4, max=100)])
psw2 = PasswordField('Repit password: ', validators=[DataRequired(), EqualTo('psw')])
submit = SubmitField('Registration')