Ejemplo n.º 1
0
class Competition(Base, DeclarativeBase):
    """The model for Book data"""
    __tablename__ = "competition"

    categories = orm.relationship(CategoryRelation,
                                  back_populates="competition")
    kernels = orm.relationship(Kernel, back_populates='competition')
Ejemplo n.º 2
0
class TechnologyRelation(DeclarativeBase):
    __tablename__ = "technology_relation"

    id = sa.Column(sa.Integer, primary_key=True)
    kernel_id = sa.Column(sa.Integer, ForeignKey("kernel.id"))
    technology_id = sa.Column(sa.Integer, ForeignKey("technology.id"))
    technology = orm.relationship("Technology", back_populates="kernels")
    kernel = orm.relationship("Kernel", back_populates="technologies")
Ejemplo n.º 3
0
class DataLinkRelation(DeclarativeBase):
    """The model for Book data"""
    __tablename__ = "data_link_relation"

    id = sa.Column(sa.Integer, primary_key=True)
    kernel_id = sa.Column(sa.Integer, ForeignKey("kernel.id"))
    data_link_id = sa.Column(sa.Integer, ForeignKey("data_link.id"))
    data_link = orm.relationship("DataLink", back_populates="kernels")
    kernel = orm.relationship("Kernel", back_populates="data_links")
Ejemplo n.º 4
0
class DataLink(Base, DeclarativeBase):
    """The model for Book data"""
    __tablename__ = "data_link"

    link = sa.Column(sa.Unicode(100))
    source_type = sa.Column(VARCHAR(100, charset='utf8'), unique=True)
    kernels = orm.relationship(DataLinkRelation, back_populates="data_link")
Ejemplo n.º 5
0
class Kernel(Base, DeclarativeBase):
    """The model for Book data"""
    __tablename__ = "kernel"

    lang = sa.Column(sa.Enum(Lang))
    notebook = sa.Column(sa.Boolean)
    votes = sa.Column(sa.Integer)
    best_score = sa.Column(sa.FLOAT)
    source_version = sa.Column(sa.Integer)
    competition_id = sa.Column(sa.Integer, ForeignKey("competition.id"))
    author_id = sa.Column(sa.Integer, ForeignKey("users.id"))
    competition = orm.relationship("Competition", back_populates="kernels")
    author = orm.relationship("User", back_populates="kernels")
    categories = orm.relationship(CategoryRelation, back_populates="kernel")
    technologies = orm.relationship(TechnologyRelation,
                                    back_populates="kernel")
    data_links = orm.relationship(DataLinkRelation, back_populates="kernel")
Ejemplo n.º 6
0
class Technology(Base, DeclarativeBase):
    """The model for Book data"""
    __tablename__ = "technology"

    kernels = orm.relationship(TechnologyRelation, back_populates="technology")
Ejemplo n.º 7
0
class Category(Base, DeclarativeBase):
    """The model for Category data"""
    __tablename__ = "category"

    description = sa.Column(VARCHAR(100, charset='utf8'))
    kernels = orm.relationship(CategoryRelation, back_populates="category")