Rename config section to [corepos.db.office_arch]

to match module rename
This commit is contained in:
Lance Edgar 2023-10-05 11:53:12 -05:00
parent aa1b53d96c
commit 6ef2e67f76

View file

@ -63,12 +63,21 @@ class RattailCOREPOSExtension(ConfigExtension):
config.coretrans_engines = engines
config.coretrans_engine = engines.get('default')
# office_trans_archive
from corepos.db.office_trans_archive import Session
engines = get_engines(config, section='corepos.db.office_trans_archive')
config.core_office_trans_archive_engines = engines
config.core_office_trans_archive_engine = engines.get('default')
Session.configure(bind=config.core_office_trans_archive_engine)
# office_arch
from corepos.db.office_arch import Session
engines = get_engines(config, section='corepos.db.office_arch')
if not engines:
engines = get_engines(config, section='corepos.db.office_trans_archive')
if engines:
warnings.warn("config section [corepos.db.office_trans_archive] is deprecated; "
"please use section [corepos.db.office_arch] instead",
DeprecationWarning)
config.core_office_arch_engines = engines
config.core_office_arch_engine = engines.get('default')
# TODO: deprecate / remove these 2
config.core_office_trans_archive_engines = config.core_office_arch_engines
config.core_office_trans_archive_engine = config.core_office_arch_engine
Session.configure(bind=config.core_office_arch_engine)
# lane_op
from corepos.db.lane_op import Session