-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmodels.py
47 lines (40 loc) · 1.38 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
45
46
47
from google.appengine.ext import db
class BetCursor(db.Model):
ordinal = db.IntegerProperty()
class TournamentModel(db.Model):
displayName = db.StringProperty()
betsAreOffDate = db.DateTimeProperty()
openingDate = db.DateTimeProperty()
description = db.StringProperty()
logo = db.StringProperty()
class TeamModel(db.Model):
tournament = db.ReferenceProperty(TournamentModel)
displayName = db.StringProperty()
logo = db.StringProperty()
class GameModel(db.Model):
homeTeam = db.ReferenceProperty(TeamModel, collection_name="homeTeam")
awayTeam = db.ReferenceProperty(TeamModel, collection_name="awayTeam")
played = db.BooleanProperty()
scored = db.BooleanProperty()
homeGoals = db.IntegerProperty()
awayGoals = db.IntegerProperty()
gameTime = db.DateTimeProperty()
ordinal = db.IntegerProperty()
class PunterModel(db.Model):
user = db.UserProperty()
displayName = db.StringProperty()
score = db.IntegerProperty(0)
rank = db.IntegerProperty()
prevRank = db.IntegerProperty()
ordinal = db.IntegerProperty()
class BetModel(db.Model):
game = db.ReferenceProperty(GameModel)
punter = db.ReferenceProperty(PunterModel)
homeGoals = db.IntegerProperty()
awayGoals = db.IntegerProperty()
score = db.IntegerProperty()
ordinal = db.IntegerProperty()
class LeaderBoardModel(db.Model):
punter = db.ReferenceProperty(PunterModel)
score = db.IntegerProperty()
prevPlace = db.IntegerProperty()