-
Notifications
You must be signed in to change notification settings - Fork 0
/
forms.py
29 lines (27 loc) · 928 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
26
27
28
29
from flask_wtf import FlaskForm
from wtforms import SubmitField, StringField, SelectMultipleField
from wtforms.validators import DataRequired
from wtforms.fields import IntegerField
from wtforms.widgets import NumberInput
class AddressForm(FlaskForm):
address = StringField("Where are you now?", validators=[DataRequired()])
number_of_locations = IntegerField(
"How many locations would you like to visit?",
widget=NumberInput(min=2, max=20, step=1),
validators=[DataRequired()],
)
quadrant = SelectMultipleField(
f"What quadrants are you interested in?",
choices=[
(v, v)
for v in [
"calgary-nw",
"calgary-ne",
"calgary-sw",
"calgary-se",
"surroundings",
]
],
validators=[DataRequired()],
)
submit = SubmitField("Feeling Lucky")