This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from sqlalchemy import create_engine | |
from sqlalchemy.orm import scoped_session, sessionmaker | |
# Simple database and session wrapper. I use it in my Flask app too. | |
class Database(object): | |
def __init__(self): | |
self.session_maker = sessionmaker() | |
self.session = scoped_session(self.session_maker) | |
self.engine = None |