1 """SQLAlchemy Metadata and Session object"""
2 from sqlalchemy
import MetaData
3 from sqlalchemy
.ext
.declarative
import declarative_base
4 from sqlalchemy
.orm
import scoped_session
, sessionmaker
6 __all__
= ['Session', 'engine', 'TableBase']
8 # SQLAlchemy database engine. Updated by model.init_model()
11 # SQLAlchemy session manager. Updated by model.init_model()
12 Session
= scoped_session(sessionmaker())
14 # Base class for declarative; creates its own metadata object
15 TableBase
= declarative_base()
16 metadata
= TableBase
.metadata