Beispiel #1
0
    def get(self):
        learn = db.Table('Learn',
                         db.metadata,
                         autoload=True,
                         autoload_with=db.engine)
        study_data = db.session.query(learn).all()

        data = list()
        for content in study_data:
            json_data = {
                "id": content.Sno,
                "grade": content.Grade,
                "subject": content.Subject,
                "topic": content.Topic
            }
            data.append(json_data)

            # print(type(author.__dict__))
        return {"content": data}, 200
from app.database.sqlalchemy_extension import db

application_moderator = db.Table(
    'application_moderator',
    db.Column('application_id', db.Integer, db.ForeignKey('application.id')),
    db.Column('moderator_id', db.Integer, db.ForeignKey('user.id')))
Beispiel #3
0
from app.database.sqlalchemy_extension import db

section_video = db.Table(
    "section_video",
    db.Column("video_id", db.Integer, db.ForeignKey("videos.id")),
    db.Column("section_id", db.Integer, db.ForeignKey("section.id")),
)
from app.database.sqlalchemy_extension import db

category_section = db.Table('category_section',
    db.Column('category_id', db.Integer, db.ForeignKey('category.id')),
    db.Column('section_id', db.Integer, db.ForeignKey('section.id'))
    )
from app.database.sqlalchemy_extension import db

section_video = db.Table('section_video',
    db.Column('video_id', db.Integer, db.ForeignKey('videos.id')),
    db.Column('section_id', db.Integer, db.ForeignKey('section.id'))
    )
from app.database.sqlalchemy_extension import db

category_section = db.Table(
    "category_section",
    db.Column("category_id", db.Integer, db.ForeignKey("category.id")),
    db.Column("section_id", db.Integer, db.ForeignKey("section.id")),
)
from app.database.sqlalchemy_extension import db

video_author = db.Table('video_author',
    db.Column('author_id', db.Integer, db.ForeignKey('author.id')),
    db.Column('video_id', db.Integer, db.ForeignKey('videos.id'))
    )
Beispiel #8
0
from app.database.sqlalchemy_extension import db

video_author = db.Table(
    "video_author",
    db.Column("author_id", db.Integer, db.ForeignKey("author.id")),
    db.Column("video_id", db.Integer, db.ForeignKey("videos.id")),
)