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_engines = engines
config.coretrans_engine = engines.get('default') config.coretrans_engine = engines.get('default')
# office_trans_archive # office_arch
from corepos.db.office_trans_archive import Session from corepos.db.office_arch import Session
engines = get_engines(config, section='corepos.db.office_trans_archive') engines = get_engines(config, section='corepos.db.office_arch')
config.core_office_trans_archive_engines = engines if not engines:
config.core_office_trans_archive_engine = engines.get('default') engines = get_engines(config, section='corepos.db.office_trans_archive')
Session.configure(bind=config.core_office_trans_archive_engine) 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 # lane_op
from corepos.db.lane_op import Session from corepos.db.lane_op import Session