Пример #1
0
class UserReputation(db.Model):
    id = db.Column(db.Integer, primary_key=True)
    user1_id = db.Column(db.Integer, db.ForeignKey('user.id'))
    user1 = db.relationship('User', foreign_keys=user1_id)
    user2_id = db.Column(db.Integer, db.ForeignKey('user.id'))
    user2 = db.relationship('User', foreign_keys=user2_id)
    type = db.Column(db.String(1))
Пример #2
0
class Scrim(db.Model):
    """
    Scrim stores information about a proposed scrim, challenge
    or finished scrim

    to be added:
    state of scrim - finished, pending, invalid, proposed, challenge...
    """

    id = db.Column(db.Integer, primary_key=True)
    date = db.Column(db.DateTime)
    map1 = db.Column(db.String(80))
    map2 = db.Column(db.String(80))
    connection = db.Column(db.String(80))
    team1_id = db.Column(db.Integer, db.ForeignKey('team.id'))
    team1 = db.relationship('Team', foreign_keys=team1_id)
    team2_id = db.Column(db.Integer, db.ForeignKey('team.id'))
    team2 = db.relationship('Team', foreign_keys=team2_id)
    type = db.Column(db.String(80))
    # possible values in consts.py
    state = db.Column(db.String(20))
    team1_log_tf = db.Column(db.String(40))
    team2_log_tf = db.Column(db.String(40))
    team1_color = db.Column(db.String(10))
    team2_color = db.Column(db.String(10))
    result = db.Column(db.String(10))
Пример #3
0
class Membership(db.Model):
    """
    A membership is made after a request is approved and deleted
    """

    id = db.Column(db.Integer, primary_key=True)
    team_id = db.Column(db.Integer, db.ForeignKey('team.id'))
    user_id = db.Column(db.Integer, db.ForeignKey('user.id'))
    role = db.Column(db.String(80))
Пример #4
0
class Request(db.Model):
    """
    A request is made when a certain member wants to join a team.
    There might be multiple requests per user for different teams.
    (need to make checks for that).

    There should be some kind of a limit to the number of requests
    that a user can make.
    """

    id = db.Column(db.Integer, primary_key=True)
    team_id = db.Column(db.Integer, db.ForeignKey('team.id'))
    user_id = db.Column(db.Integer, db.ForeignKey('user.id'))
Пример #5
0
class Message(db.Model):
    id = db.Column(db.Integer, primary_key=True)
    to = db.Column(db.Integer)
    frm = db.Column(db.Integer, db.ForeignKey('user.id'))
    message = db.Column(db.Text)
    timestamp = db.Column(db.String(20))
    subject = db.Column(db.String(45))
    is_read = db.Column(db.Integer, default=0)
Пример #6
0
class SingleScrim(db.Model):
    id = db.Column(db.Integer, primary_key=True)
    leader_id = db.Column(db.Integer, db.ForeignKey('user.id'))
    skill_level = db.Column(db.String(80))
    is_accepted = db.Column(db.Integer)
    type = db.Column(db.String(45))
    time_zone = db.Column(db.String(80))
    date = db.Column(db.DateTime)
    epoch = db.Column(db.Integer)
    comment = db.Column(db.Text)
    maps = db.Column(db.String(400))
    is_flash = db.Column(db.Integer)
    bumped = db.Column(db.Integer)
Пример #7
0
class Reputation(db.Model):
    id = db.Column(db.Integer, primary_key=True)
    user_id = db.Column(db.Integer, db.ForeignKey('user.id'))
    team_id = db.Column(db.Integer, db.ForeignKey('team.id'))
    type = db.Column(db.String(1))
Пример #8
0
class Comment(db.Model):
    id = db.Column(db.Integer, primary_key=True)
    team_id = db.Column(db.Integer, db.ForeignKey('team.id'))
    user_id = db.Column(db.Integer, db.ForeignKey('user.id'))
    comment = db.Column(db.Text)