-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmodels.py
More file actions
47 lines (40 loc) · 1.53 KB
/
models.py
File metadata and controls
47 lines (40 loc) · 1.53 KB
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
# The data model for Rowing Competition Network assumes we are using it with a non-relational database
from google.appengine.ext import ndb
class Accounts(ndb.Model):
auth_id = ndb.IntegerProperty()
email = ndb.StringProperty()
username = ndb.StringProperty()
admin = ndb.BooleanProperty()
class Events(ndb.Model):
event_name = ndb.StringProperty()
event_date = ndb.DateProperty()
event_desc = ndb.StringProperty()
class Stages(ndb.Model):
event_id = ndb.KeyProperty(kind = Events)
stage_index = ndb.IntegerProperty()
label = ndb.StringProperty()
class Rowers(ndb.Model):
account_id = ndb.KeyProperty(kind= Accounts)
name = ndb.StringProperty()
email = ndb.StringProperty()
club = ndb.StringProperty()
pic = ndb.BlobProperty()
class Crews(ndb.Model):
event_id = ndb.KeyProperty(kind= Events)
crew_number = ndb.IntegerProperty()
division = ndb.IntegerProperty()
crew_name = ndb.StringProperty()
pic_file = ndb.StringProperty()
crew_type = ndb.StringProperty()
rower_count = ndb.IntegerProperty()
cox = ndb.BooleanProperty()
rower_id = ndb.KeyProperty(kind=Rowers, repeated=True)
class Observed_Times(ndb.Model):
event_id = ndb.KeyProperty(kind=Events)
timestamp = ndb.DateTimeProperty()
obs_type = ndb.IntegerProperty() #added 31/8 0 is an add 1 is a delete
crew_number = ndb.IntegerProperty()
stage = ndb.IntegerProperty()
time_local = ndb.DateTimeProperty()
time_server = ndb.DateTimeProperty()
recorded_by = ndb.StringProperty()