예제 #1
0
class Rights(DB.Model):
    """Access rights"""

    name = DB.Column(DB.String(50), primary_key=True)
    group = DB.Column(DB.String(50), nullable=False)
    permission = DB.Column(DB.String(50), nullable=False)
    description = DB.Column(DB.String(255), nullable=False)
예제 #2
0
class Rights(DB.Model):
    """Access rights"""

    uid = DB.Column(UUID, primary_key=True, default=uuid.uuid4)
    name = DB.Column(DB.String(50), nullable=False, unique=True)
    group = DB.Column(DB.String(50), nullable=False)
    permission = DB.Column(DB.String(50), nullable=False)
    description = DB.Column(DB.String(255), nullable=False)
예제 #3
0
class User(DB.Model):
    """User data model"""

    uid = DB.Column(UUID, primary_key=True, default=uuid.uuid4)
    email = DB.Column(DB.String(255), nullable=False, unique=True)
    password = DB.Column(DB.String(255), nullable=False, server_default='')
    confirmed_at = DB.Column(DB.DateTime())
    gdpr_version = DB.Column(DB.Integer, nullable=False)
    is_active = DB.Column(DB.Boolean(), nullable=False, server_default='0')
예제 #4
0
class Player(DB.Model):
    """User data model"""

    uid = DB.Column(UUID, primary_key=True, default=uuid.uuid4)
    user_uid = DB.Column(UUID, DB.ForeignKey('user.uid'), nullable=False)
    steam_id = DB.Column(DB.Integer, nullable=False)
    name = DB.Column(DB.String(50), nullable=False, unique=True)
    avatar = DB.Column(DB.String(300), nullable=False, unique=True)
    avatar_medium = DB.Column(DB.String(300), nullable=False, unique=True)
    avatar_full = DB.Column(DB.String(300), nullable=False, unique=True)

    user = DB.relationship('User', back_populates='players', lazy='select')
예제 #5
0
class User(DB.Model):
    """User data model"""

    __tablename__ = 'users'

    id = DB.Column(DB.Integer, primary_key=True)  # pylint: disable=invalid-name
    steam_id = DB.Column(DB.String(50), nullable=False, unique=True)
    created_at = DB.Column(DB.DateTime())
예제 #6
0
class Token(DB.Model):
    """Token data model"""

    uid = DB.Column(UUID, primary_key=True, default=uuid.uuid4)
    token_type = DB.Column(DB.Integer, nullable=False)
    created_at = DB.Column(DB.DateTime(), nullable=False)
    valid_until = DB.Column(DB.DateTime(), nullable=False)
    is_active = DB.Column(DB.Boolean(), nullable=False, server_default='1')
    user_uid = DB.Column(UUID, DB.ForeignKey('user.uid'), nullable=False)
    note = DB.Column(DB.String(20), nullable=False, server_default='')

    user = DB.relationship('User', back_populates='tokens', lazy='select')
예제 #7
0
class RoleRights(DB.Model):
    """Connection roles <--> rights"""

    uid = DB.Column(UUID, primary_key=True, default=uuid.uuid4)
    role = DB.Column(DB.String(50), nullable=False)
    rights = DB.Column(DB.String(50), nullable=False)
예제 #8
0
class Role(DB.Model):
    """User Roles"""

    name = DB.Column(DB.String(50), primary_key=True)
예제 #9
0
class User(DB.Model):
    user_id = DB.Column(DB.String(40), primary_key=True)
    first_name = DB.Column(DB.String(100))
    last_name = DB.Column(DB.String(100))
예제 #10
0
class UserRole(DB.Model):
    """User Roles"""

    uid = DB.Column(UUID, primary_key=True, default=uuid.uuid4)
    name = DB.Column(DB.String(50), nullable=False, unique=True)