forked from namitdoshi/car-damage-detective-web
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathforms.py
19 lines (15 loc) · 824 Bytes
/
forms.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
from flask_wtf import FlaskForm
from wtforms import StringField, PasswordField, SubmitField
from wtforms.validators import DataRequired, Length, Email
from flask_wtf.file import FileField, FileAllowed
class RegisterationForm(FlaskForm):
username = StringField('Username', validators=[DataRequired(), Length(min=2, max=20)])
email = StringField('Email', validators=[DataRequired(), Email()])
password = PasswordField('Password', validators=[DataRequired()])
submit = SubmitField('Sign up')
class LoginForm(FlaskForm):
email = StringField('Email', validators=[DataRequired(), Email()])
password = PasswordField('Password', validators=[DataRequired()])
submit = SubmitField('Login')
class UpdateAccountForm(FlaskForm):
picture = FileField('Update Profile Picture', validators=[FileAllowed(['jpg', 'png'])])