2008-06-03 23:31:37 +02:00
|
|
|
import sqlalchemy as sa
|
|
|
|
from sqlalchemy import orm
|
|
|
|
|
|
|
|
from gnuviechadminweb.model import meta
|
|
|
|
|
|
|
|
def init_model(engine):
|
|
|
|
"""Call me before using any of the tables or classes in the model."""
|
|
|
|
|
|
|
|
sm = orm.sessionmaker(autoflush=True, transactional=True, bind=engine)
|
|
|
|
|
|
|
|
meta.engine = engine
|
|
|
|
meta.Session = orm.scoped_session(sm)
|
|
|
|
|
|
|
|
from gnuviechadminweb.model import menu
|
|
|
|
from gnuviechadminweb.model.menu import Menu, User, Role
|