summaryrefslogtreecommitdiff
path: root/db/db.py
blob: a03918063d8b0562fde5177fd74f59354d908980 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
from flask_sqlalchemy import SQLAlchemy

from app import app

from db.user import DBUser
from db.quiz import DBQuiz
from db.question import DBQuestion
from db.answer import DBAnswer
from db.analyse import DBAnalyse

class DB:
    def __init__(self):
        self.db = SQLAlchemy()
        self.db.init_app(app)

        self.user = DBUser(self.db)
        self.quiz = DBQuiz(self.db)
        self.question = DBQuestion(self.db)
        self.answer = DBAnswer(self.db)
        self.analyse = DBAnalyse(self.db)