-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmodels.py
45 lines (39 loc) · 1.31 KB
/
models.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 couchdb.mapping import Document, TextField, IntegerField, BooleanField, DateTimeField, ListField, Mapping,DictField
class Venue(Document):
name = TextField()
city = TextField()
state = TextField()
address = TextField()
phone = TextField()
image_link = TextField()
facebook_link = TextField()
website = TextField()
seeking_talent = BooleanField(default=False)
seeking_description = TextField()
genres = ListField(TextField())
shows = ListField(DictField(Mapping.build(start_time=DateTimeField(),
id_Artist=TextField())))
class Artist(Document):
name = TextField()
city = TextField()
state = TextField()
phone = TextField()
image_link = TextField()
facebook_link = TextField()
website = TextField()
seeking_venue = BooleanField(default=False)
seeking_description = TextField()
genres = ListField(TextField())
shows = ListField(DictField(Mapping.build(start_time=DateTimeField(),
id_Venue=TextField())))
class Show(Document):
start_time = DateTimeField()
artist = Mapping.build(
id=TextField(),
name=TextField(),
image_link=TextField()
)
venue = Mapping.build(
id=TextField(),
name=TextField()
)