-
Notifications
You must be signed in to change notification settings - Fork 32
/
forms.py
38 lines (28 loc) · 1.33 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
from wtforms import Form, TextField, IntegerField, validators
class FilterForm(Form):
filter_id = IntegerField('filter_id')
openid = TextField('openid', [validators.Required()])
context = TextField('context', [validators.Required()])
filter_name = TextField('filter_name', [validators.Required()])
method = TextField('method')
class DetailsForm(Form):
openid = TextField('openid', [validators.Required()])
context = TextField('context', [validators.Required()])
detail_value = TextField('detail_value')
# We really want these to be integers, but I don't know how to allow that
# to also be "None"
batch_delta = TextField('batch_delta')
batch_count = TextField('batch_delta')
# Did they press the button?
toggle_enable = TextField('toggle_enable')
toggle_triggered_by = TextField('toggle_triggered_by')
toggle_shorten = TextField('toggle_shorten')
toggle_markup = TextField('toggle_markup')
next_url = TextField('next_url')
reset_to_defaults = TextField('reset_to_defaults')
class RuleForm(Form):
openid = TextField('openid', [validators.Required()])
context = TextField('context', [validators.Required()])
filter_id = IntegerField('filter_id', [validators.Required()])
rule_name = TextField('rule_name', [validators.Required()])
method = TextField('method')