-
Notifications
You must be signed in to change notification settings - Fork 0
/
forms.py
21 lines (15 loc) · 757 Bytes
/
forms.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# -*- coding: utf-8 -*-
from wtforms import Form, BooleanField, StringField, PasswordField, validators
class SearchForm(Form):
search = StringField('Search', [validators.DataRequired()])
class AddressSearchForm(Form):
addr = StringField('Address', [validators.DataRequired()])
class RegistrationForm(Form):
username = StringField('Username', [validators.Length(min=4, max=25)])
email = StringField('Email Address', [validators.Length(min=6, max=35)])
password = PasswordField('New Password', [
validators.DataRequired(),
validators.EqualTo('confirm', message='Passwords must match')
])
confirm = PasswordField('Repeat Password')
accept_tos = BooleanField('I accept the TOS', [validators.DataRequired()])