-
Notifications
You must be signed in to change notification settings - Fork 0
/
forms.py
34 lines (30 loc) · 1.79 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
from flask_wtf import FlaskForm
from wtforms import StringField, SubmitField, SelectField
from wtforms.validators import DataRequired, URL
choices = ['✅', '❌']
class Search(FlaskForm):
location = StringField("Location", validators=[DataRequired()])
submit = SubmitField("Search")
class Add(FlaskForm):
name = StringField("Name", validators=[DataRequired()])
map_url = StringField("Maps Link", validators=[DataRequired(), URL()])
img_url = StringField("Image Link", validators=[DataRequired(), URL()])
location = StringField("Location", validators=[DataRequired()])
has_sockets = SelectField('Has Sockets', choices=choices, validators=[DataRequired()])
has_toilet = SelectField('Has Toilet', choices=choices, validators=[DataRequired()])
has_wifi = SelectField('Has Wifi', choices=choices, validators=[DataRequired()])
can_take_calls = SelectField('Can Take Calls', choices=choices, validators=[DataRequired()])
seats = StringField("Seats", validators=[DataRequired()])
coffee_price = StringField("Coffe Price", validators=[DataRequired()])
submit = SubmitField("Add")
cancel = SubmitField('Cancel')
class Update(FlaskForm):
img_url = StringField("Image Link", validators=[DataRequired(), URL()])
has_sockets = SelectField('Has Sockets', choices=choices, validators=[DataRequired()])
has_toilet = SelectField('Has Toilet', choices=choices, validators=[DataRequired()])
has_wifi = SelectField('Has Wifi', choices=choices, validators=[DataRequired()])
can_take_calls = SelectField('Can Take Calls', choices=choices, validators=[DataRequired()])
seats = StringField("Seats", validators=[DataRequired()])
coffee_price = StringField("Coffe Price", validators=[DataRequired()])
submit = SubmitField("Confirm")
cancel = SubmitField('Cancel')