#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_engine from pylons.database import session_context as ctx from pylons.database import create_engine try: 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()