diff --git a/rattail_corepos/config.py b/rattail_corepos/config.py index 72c7cd1..c6cb8d2 100644 --- a/rattail_corepos/config.py +++ b/rattail_corepos/config.py @@ -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