[docs]classWuttaCoreposConfigExtension(WuttaConfigExtension):""" App :term:`config extension` for Wutta-COREPOS. This does some CORE DB connection setup based on config. It will create three sets of DB engines, and establish one primary engine for each set. The sets correspond to CORE Office DB types: * ``office_op`` (default name ``core_op``) * ``office_trans`` (default name ``core_trans``) * ``office_arch`` (default name ``trans_archive``) The :term:`config object` will be given the following attributes: .. data:: core_office_op_engine Primary engine for the ``office_op`` DB. May be null if no config is found. .. data:: core_office_op_engines Dict of ``office_op`` DB engines. May be empty if no config is found; otherwise there should at least be a ``default`` key defined, corresonding to :data:`core_office_op_engine`. .. data:: core_office_trans_engine Primary engine for the ``office_trans`` DB. May be null if no config is found. .. data:: core_office_trans_engines Dict of ``office_trans`` DB engines. May be empty if no config is found; otherwise there should at least be a ``default`` key defined, corresonding to :data:`core_office_trans_engine`. .. data:: core_office_arch_engine Primary engine for the ``office_arch`` DB. May be null if no config is found. .. data:: core_office_arch_engines Dict of ``office_arch`` DB engines. May be empty if no config is found; otherwise there should at least be a ``default`` key defined, corresonding to :data:`core_office_arch_engine`. """key='wutta_corepos'defconfigure(self,config):""" """# office_opfromcorepos.db.office_opimportSessionengines=get_engines(config,'corepos.db.office_op')config.core_office_op_engines=enginesconfig.core_office_op_engine=engines.get('default')Session.configure(bind=config.core_office_op_engine)# office_transfromcorepos.db.office_transimportSessionengines=get_engines(config,'corepos.db.office_trans')config.core_office_trans_engines=enginesconfig.core_office_trans_engine=engines.get('default')Session.configure(bind=config.core_office_trans_engine)# office_archfromcorepos.db.office_archimportSessionengines=get_engines(config,'corepos.db.office_arch')config.core_office_arch_engines=enginesconfig.core_office_arch_engine=engines.get('default')Session.configure(bind=config.core_office_arch_engine)# define some schema columns "late" unless not supportedifconfig.get_bool('corepos.db.office_op.use_latest_columns',default=True,usedb=False):fromcorepos.db.office_op.modelimportuse_latest_columnsuse_latest_columns()