-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathforms.py
71 lines (53 loc) · 1.86 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
'''
Uses flask_wtf, en extension for Flask, for generating forms ans usage in the app.
'''
from flask_wtf import Form
from wtforms import TextField, PasswordField
from wtforms.validators import DataRequired, EqualTo, Length
# Set your classes here.
class RegisterForm(Form):
name = TextField(
'Username', validators=[DataRequired(), Length(min=6, max=25)]
)
email = TextField(
'Email', validators=[DataRequired(), Length(min=6, max=40)]
)
fullname = TextField(
'Full Name', validators=[DataRequired(), Length(min=6, max=25)]
)
password = PasswordField(
'Password', validators=[DataRequired(), Length(min=6, max=40)]
)
confirm = PasswordField(
'Repeat Password',
[DataRequired(),
EqualTo('password', message='Passwords must match')]
)
class LoginForm(Form):
name = TextField('Username', [DataRequired()])
password = PasswordField('Password', [DataRequired()])
class TokenizerForm(Form):
text = TextField('Input Text', [DataRequired()])
class ForgotForm(Form):
email = TextField(
'Email', validators=[DataRequired(), Length(min=6, max=40)]
)
class AddServiceForm(Form):
serviceName = TextField(
'Service Name', validators=[DataRequired(), Length(min=2, max=25)]
)
serviceAuthor = TextField(
'Service Author', validators=[DataRequired(), Length(min=3, max=40)]
)
servicePageCall = TextField(
'Service page call', validators=[DataRequired(), Length(min=2, max=25)]
)
serviceServiceCall = TextField(
'Service call', validators=[DataRequired(), Length(min=2, max=25)]
)
serviceAPIEndpoint = TextField(
'Service endpoint', validators=[DataRequired(), Length(min=2, max=25)]
)
serviceTags = TextField(
'Service tags', validators=[DataRequired(), Length(min=2, max=25)]
)