def __init__(self): #env = pow.global_conf["ENV"] logging = pow.logging["SQLALCHEMY_LOGGING"] if logging == "True": PowBaseObject.__engine__= create_engine(powlib.get_db_conn_str(), echo = True) else: PowBaseObject.__engine__= create_engine(powlib.get_db_conn_str(), echo = False) PowBaseObject.__metadata__.bind = PowBaseObject.__engine__ PowBaseObject.__session__.configure( bind = PowBaseObject.__engine__ )
def __init__(self): PowObject.__engine__= create_engine(powlib.get_db_conn_str()) PowObject.__metadata__ = MetaData() PowObject.__metadata__.bind = PowObject.__engine__ PowObject.__metadata__.reflect(PowObject.__engine__) PowObject.__session__= sessionmaker() PowObject.__session__.configure(bind=PowObject.__engine__)
def __init__(self): PowBaseObject.__engine__= create_engine(powlib.get_db_conn_str()) PowBaseObject.__metadata__.bind = PowBaseObject.__engine__ PowBaseObject.__session__.configure( bind = PowBaseObject.__engine__ )