-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathforms.py
25 lines (16 loc) · 904 Bytes
/
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
from wtforms import Form, StringField, DecimalField, IntegerField, TextAreaField, PasswordField, validators
# form used on Register page
class RegisterForm(Form):
name = StringField('Full Name', [validators.Length(min=1, max=50)])
username = StringField('Username', [validators.Length(min=4, max=25)])
email = StringField('Email', [validators.Length(min=6, max=50)])
password = PasswordField('Password', [validators.DataRequired(
), validators.EqualTo('confirm', message='Passwords do not match')])
confirm = PasswordField('Confirm Password')
# form used on the Transactions page
class SendMoneyForm(Form):
username = StringField('Username', [validators.Length(min=4, max=25)])
amount = StringField('Amount', [validators.Length(min=1, max=5)])
# form used on the Buy page
class BuyForm(Form):
amount = StringField('Amount', [validators.Length(min=1, max=3)])