-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathforms.py
executable file
·54 lines (48 loc) · 1.91 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
from datetime import datetime
from flask_wtf import Form
from wtforms import (
BooleanField,
DateTimeField,
SelectField,
SelectMultipleField,
StringField,
)
from wtforms.validators import DataRequired, URL
from constants import GENRES, STATES
class ShowForm(Form):
artist_id = StringField("artist_id")
venue_id = StringField("venue_id")
start_time = DateTimeField(
"start_time", validators=[DataRequired()], default=datetime.today()
)
class VenueForm(Form):
name = StringField("name", validators=[DataRequired()])
city = StringField("city", validators=[DataRequired()])
state = SelectField("state", validators=[DataRequired()], choices=STATES,)
address = StringField("address", validators=[DataRequired()])
phone = StringField("phone")
image_link = StringField("image_link")
genres = SelectMultipleField(
"genres", validators=[DataRequired()], choices=GENRES,
)
facebook_link = StringField("facebook_link", validators=[URL()])
website = StringField("website")
seeking_talent = BooleanField(
"seeking_talent", default=True, false_values=("false", "")
)
seeking_description = StringField("seeking_description")
class ArtistForm(Form):
name = StringField("name", validators=[DataRequired()])
city = StringField("city", validators=[DataRequired()])
state = SelectField("state", validators=[DataRequired()], choices=STATES,)
phone = StringField("phone")
genres = SelectMultipleField(
"genres", validators=[DataRequired()], choices=GENRES,
)
image_link = StringField("image_link", validators=[URL()],)
facebook_link = StringField("facebook_link", validators=[URL()],)
website = StringField("website", validators=[URL()],)
seeking_venue = BooleanField(
"seeking_venue", default=True, false_values=(False, "false", "")
)
seeking_description = StringField("seeking_description")