Esempio n. 1
0
class VisitorModel(Model):
    __tablename__ = "visitor"

    id = fields.Integer(primary_key=True)
    name = fields.String(index=True, max_length=64)
    ip_addr = fields.String(index=True, max_length=15)
    location = fields.String(allow_null=True, max_length=64)
Esempio n. 2
0
class SideModel(Model):
    __tablename__ = "side"

    id = fields.Integer(primary_key=True)
    name = fields.String(max_length=64)
    member_key = fields.String(unique=True, max_length=64)
    stats_key = fields.ForeignKey(StatsKeyModel)
Esempio n. 3
0
class VisitModel(Model):
    __tablename__ = "visit"

    id = fields.Integer(primary_key=True)
    visited_on = fields.DateTime(default=datetime.datetime.utcnow)
    message = fields.String(max_length=64)
    visitor = fields.ForeignKey(VisitorModel)
Esempio n. 4
0
class GameModel(Model):
    __tablename__ = "game"

    id = fields.Integer(primary_key=True)
    name = fields.String(max_length=64, unique=True)
    side_size_min = fields.Integer(default=1)
    side_size_max = fields.Integer(default=2)
    side_count_min = fields.Integer(default=2)
    side_count_max = fields.Integer(default=2)
Esempio n. 5
0
class PlayerModel(Model):
    __tablename__ = "player"

    id = fields.Integer(primary_key=True)
    name = fields.String(max_length=64, unique=True)
    stats_key = fields.ForeignKey(StatsKeyModel)