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

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)