Configure DB connections for CORE trans archive on app startup

This commit is contained in:
Lance Edgar 2022-03-26 23:04:40 -05:00
parent 57ea39acb5
commit 82ad5ad441

View file

@ -2,7 +2,7 @@
################################################################################ ################################################################################
# #
# Rattail -- Retail Software Framework # Rattail -- Retail Software Framework
# Copyright © 2010-2021 Lance Edgar # Copyright © 2010-2022 Lance Edgar
# #
# This file is part of Rattail. # This file is part of Rattail.
# #
@ -56,6 +56,13 @@ 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
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)
# lane_op # lane_op
from corepos.db.lane_op import Session from corepos.db.lane_op import Session
engines = get_engines(config, section='corepos.db.lane_op') engines = get_engines(config, section='corepos.db.lane_op')