示例#1
0
def configure_db(options, models_mapper=None):
    global _ENGINE
    if not _ENGINE:
        _ENGINE = _create_engine(options)
    if models_mapper:
        models_mapper.map(_ENGINE)
    else:
        mappers.map(_ENGINE, ipam.models.persisted_models())
示例#2
0
def configure_db(options, models_mapper=None):
    configure_sqlalchemy_log(options)
    global _ENGINE
    if not _ENGINE:
        _ENGINE = _create_engine(options)
    if models_mapper:
        models_mapper.map(_ENGINE)
    else:
        mappers.map(_ENGINE, ipam.models.persisted_models())
示例#3
0
文件: session.py 项目: markmc/melange
def configure_db(options):
    configure_sqlalchemy_log(options)
    global _ENGINE
    if not _ENGINE:
        _ENGINE = _create_engine(options)
        mappers.map(_ENGINE, ipam.models.persisted_models())