forked from alexraison/Magic
-
Notifications
You must be signed in to change notification settings - Fork 0
/
forms.py
44 lines (34 loc) · 2.01 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
from flask.ext.wtf import Form
from wtforms import TextField, SelectField, SelectMultipleField, validators, RadioField, BooleanField
from wtforms.validators import Required, Length
class AddPlayer(Form):
username = TextField('Username', validators = [Required(), validators.Length(min=2, max=30)])
name = TextField('Name', validators = [Required(), validators.Length(min=2, max=30)])
slack_user = TextField('slack_user', validators = [Required(), validators.Length(min=2, max=21)])
password = TextField('Password', validators = [Required(), validators.Length(min=6, max=30)])
class EditPlayer(Form):
name = TextField('Name', validators = [Required(), validators.Length(min=2, max=30)])
slack_user = TextField('slack_user', validators = [Required(), validators.Length(min=2, max=21)])
class AddTournament(Form):
name = TextField('Name', validators = [Required(), validators.Length(min=2, max=50)])
set = SelectField('Set', validators = [Required()])
players = SelectMultipleField('Players')
class AddTwoHeadedGiantTournament(Form):
name = TextField('Name', validators = [Required(), validators.Length(min=2, max=50)])
set = SelectField('Set', validators = [Required()])
pairs = SelectMultipleField('Pairs')
class EditTournament(Form):
name = TextField('Name', validators = [Required(), validators.Length(min=2, max=50)])
set = SelectField('Set', validators = [Required()])
class AddSet(Form):
name = TextField('Name', validators = [Required(), validators.Length(min=2, max=50)])
constructed = BooleanField('Constructed')
class EditSet(Form):
name = TextField('Name', validators = [Required(), validators.Length(min=2, max=50)])
constructed = BooleanField('Constructed')
class AddPair(Form):
players = SelectMultipleField('Players')
class Pairings(Form):
players = SelectMultipleField('Players')
class RemoveParticipant(Form):
participant = SelectField('Participant')