-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathforms.py
More file actions
35 lines (28 loc) · 1.23 KB
/
forms.py
File metadata and controls
35 lines (28 loc) · 1.23 KB
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
from flask.ext.wtf import Form, TextField, PasswordField, BooleanField, validators
import wtforms.form
import models
class SetUser(wtforms.form.Form):
email = TextField('Email address', [
validators.Required("It's okay, we won't email you unless you want us to."),
validators.Email("Um, that doesn't look like an email address."),
])
password = PasswordField('Password', [
validators.Required("How else will we know it's really you?"),
])
retype = PasswordField('Password (again)', [
validators.EqualTo('password', message="If you can't type it twice now, you'll never be able to log in with it."),
])
class Login(Form):
email = TextField('Email address', validators=[
validators.Email('Please supply an email address.')
])
password = PasswordField('Password', validators=[
validators.Required('Please supply a password.')
])
class Password(Form):
password = PasswordField('Password', [
validators.Required('How else will we know it’s really you?'),
])
retype = PasswordField('Password (again)', [
validators.EqualTo('password', message='If you can’t type it twice now, you’ll never be able to log in with it.')
])