-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathforms.py
52 lines (42 loc) · 1.37 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
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Project File: Python 2.x or 3.x
# DESCRIPTION
"""
"""
__author__ = "Adam Dabdoub"
__copyright__ = "Copyright 2021, Dabdoub"
__credits__ = ["Adam Dabdoub"]
__developers__ = ["adamdabdoub "]
__license__ = "GPL"
__version__ = "1.0."
__maintainer__ = "Adam Dabdoub"
__email__ = "[email protected]"
__status__ = "Production"
#IMPORTS
from wtforms import (
Form, StringField, DecimalField,
IntegerField, TextAreaField, PasswordField,
validators
)
"""FORMS: registration, login, messaging
setup class for each
"""
#User registration form
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')
#Send money form
class SendMoneyForm(Form):
username = StringField('Username', [validators.Length(min=4,max=25)])
amount = StringField('Amount',[validators.Length(min=1,max=50)])
#Buy DAB form
class BuyDabdoub(Form):
amount = StringField('Amount',[validators.Length(min=1,max=50)])
key = StringField('Key', [validators.Length(min=4,max=25)])