create basic TimeSettings model
This commit is contained in:
parent
52ad450fb9
commit
56ffeb2a01
2 changed files with 26 additions and 1 deletions
|
@ -13,7 +13,7 @@ class Message(db.Model):
|
||||||
content = db.Column(db.String(200))
|
content = db.Column(db.String(200))
|
||||||
|
|
||||||
# foreing key
|
# foreing key
|
||||||
game = db.Column(db.Integer, db.ForeignKey("move.id"))
|
move = db.Column(db.Integer, db.ForeignKey("move.id"))
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
pass
|
pass
|
|
@ -0,0 +1,25 @@
|
||||||
|
from ..app import db, ma
|
||||||
|
import enum
|
||||||
|
|
||||||
|
class TimeTypes(enum.Enum):
|
||||||
|
BYOYOMI = "Counting by time period"
|
||||||
|
ABSOLUTE = "One period to use time"
|
||||||
|
HOURGLASS = "Absolute time for both players"
|
||||||
|
NONE = "Untimed"
|
||||||
|
|
||||||
|
class TimeSettings(db.Model):
|
||||||
|
__table_args__ = {'extend_existing': True}
|
||||||
|
|
||||||
|
id = db.Column(db.Integer, primary_key=True)
|
||||||
|
main_time = db.Column(db.Enum(Time))
|
||||||
|
time_period = db.Column(db.Integer) # number of periods
|
||||||
|
period_length = db.Column(db.Integer) # seconds
|
||||||
|
overtime = db.Column(db.Enum())
|
||||||
|
overtime_period = db.Column(db.Integer) # number of overtime periods
|
||||||
|
overtime_length = db.Column(db.Integer) # seconds
|
||||||
|
|
||||||
|
# foreing key
|
||||||
|
game = db.Column(db.Integer, db.ForeignKey("game.id"))
|
||||||
|
|
||||||
|
def __init__(self):
|
||||||
|
pass
|
Loading…
Reference in a new issue