[r3653]: trunk / tg / templates / turbogears / +package+ / model / __init__.py_tmpl Maximize Restore History

Download this file

__init__.py_tmpl    13 lines (10 with data), 512 Bytes

from pylons import config
from sqlalchemy import Column, MetaData, Table, types
from sqlalchemy.orm import mapper, relation
from sqlalchemy.orm import scoped_session, sessionmaker

# Global session manager.  Session() returns the session object
# appropriate for the current web request.
DBSession = scoped_session(sessionmaker(autoflush=True, transactional=True))

# Global metadata. If you have multiple databases with overlapping table
# names, you'll need a metadata for each database.
metadata = MetaData()