All pastes #744716 Raw Edit

Someone

public python v1 · immutable
·published 2007-10-21 18:55 UTC
rendered paste body
#import form import db_access# Loads the DB wrapper. This is deprecated, I guess something# better appears in later Pylons versions, but for now I don't# know what else I should use for SQLAlchemy 0.3.10.#from pylons.database import create_enginefrom pylons.database import session_context as ctxfrom pylons.database import create_enginetry:     from pylons.database import session_context as ctx    from pylons.database import create_engine    engine = create_engine(encoding="utf8", convert_unicode=True)    db = db_access.db_access(ctx, engine)except:    # Probably running as unit test, have to create the DBAccess without create_engine()    db = db_access.db_access()