browser-go-api/models/TimeSettings.py

23 lines
762 B
Python
Raw Normal View History

2019-10-04 22:00:47 +00:00
from app import db, ma
2019-10-02 03:42:21 +00:00
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):
2019-10-02 20:55:09 +00:00
__table_args__ = {'extend_existing': True}
2019-10-02 03:42:21 +00:00
2019-10-02 20:55:09 +00:00
id = db.Column(db.Integer, primary_key=True, autoincrement=True)
main_time = db.Column(db.Enum(TimeTypes), nullable=False)
2019-10-02 03:42:21 +00:00
time_period = db.Column(db.Integer) # number of periods
period_length = db.Column(db.Integer) # seconds
2019-10-02 20:55:09 +00:00
overtime = db.Column(db.Enum(TimeTypes), nullable=False)
2019-10-02 03:42:21 +00:00
overtime_period = db.Column(db.Integer) # number of overtime periods
overtime_length = db.Column(db.Integer) # seconds
def __init__(self):
pass