-
Notifications
You must be signed in to change notification settings - Fork 0
/
forms.py
53 lines (35 loc) · 1.39 KB
/
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
from flask_wtf import FlaskForm
from wtforms import StringField, PasswordField, SubmitField, BooleanField
from wtforms.validators import (
DataRequired, Length, Email, EqualTo, InputRequired, ValidationError
)
from flask import Flask
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('create account')
class LoginForm(FlaskForm):
email = StringField('email',
validators=[DataRequired(), Email()])
password = PasswordField('password', validators=[InputRequired()])
submit = SubmitField('login')
class CreateAccount(FlaskForm):
submit = SubmitField('create account')
class TakeMeThere(FlaskForm):
submit = SubmitField('take me there')
class Happy(FlaskForm):
submit = SubmitField('happy :)')
class Sad(FlaskForm):
submit = SubmitField('sad :(')
class Bored(FlaskForm):
submit = SubmitField('bored :/')
class History(FlaskForm):
submit = SubmitField('history')
class Content(FlaskForm):
submit = SubmitField('back to content')