feat: add basic readonly web views for CORE members, products
also adds canonical web app db sessions for CORE also adds some methods to corepos handler, to get model / make session
This commit is contained in:
parent
b134e340ff
commit
05f428586b
22 changed files with 655 additions and 2 deletions
|
@ -21,7 +21,7 @@
|
|||
#
|
||||
################################################################################
|
||||
"""
|
||||
CORE-POS Handler
|
||||
CORE-POS Integration Handler
|
||||
"""
|
||||
|
||||
from wuttjamaican.app import GenericHandler
|
||||
|
@ -33,6 +33,72 @@ class CoreposHandler(GenericHandler):
|
|||
:term:`handler`.
|
||||
"""
|
||||
|
||||
def get_model_office_op(self):
|
||||
"""
|
||||
Returns the :term:`data model` module for CORE Office 'op' DB,
|
||||
i.e. :mod:`pycorepos:corepos.db.office_op.model`.
|
||||
"""
|
||||
from corepos.db.office_op import model
|
||||
|
||||
return model
|
||||
|
||||
def get_model_office_trans(self):
|
||||
"""
|
||||
Returns the :term:`data model` module for CORE Office 'trans'
|
||||
DB, i.e. :mod:`pycorepos:corepos.db.office_trans.model`.
|
||||
"""
|
||||
from corepos.db.office_trans import model
|
||||
|
||||
return model
|
||||
|
||||
def get_model_office_arch(self):
|
||||
"""
|
||||
Returns the :term:`data model` module for CORE Office 'arch'
|
||||
DB, i.e. :mod:`pycorepos:corepos.db.office_arch.model`.
|
||||
"""
|
||||
from corepos.db.office_arch import model
|
||||
|
||||
return model
|
||||
|
||||
def make_session_office_op(self, dbkey='default', **kwargs):
|
||||
"""
|
||||
Make a new :term:`db session` for the CORE Office 'op' DB.
|
||||
|
||||
:returns: Instance of
|
||||
:class:`pycorepos:corepos.db.office_op.Session`.
|
||||
"""
|
||||
from corepos.db.office_op import Session
|
||||
|
||||
if 'bind' not in kwargs:
|
||||
kwargs['bind'] = self.config.core_office_op_engines[dbkey]
|
||||
return Session(**kwargs)
|
||||
|
||||
def make_session_office_trans(self, dbkey='default', **kwargs):
|
||||
"""
|
||||
Make a new :term:`db session` for the CORE Office 'trans' DB.
|
||||
|
||||
:returns: Instance of
|
||||
:class:`pycorepos:corepos.db.office_trans.Session`.
|
||||
"""
|
||||
from corepos.db.office_trans import Session
|
||||
|
||||
if 'bind' not in kwargs:
|
||||
kwargs['bind'] = self.config.core_office_trans_engines[dbkey]
|
||||
return Session(**kwargs)
|
||||
|
||||
def make_session_office_arch(self, dbkey='default', **kwargs):
|
||||
"""
|
||||
Make a new :term:`db session` for the CORE Office 'arch' DB.
|
||||
|
||||
:returns: Instance of
|
||||
:class:`pycorepos:corepos.db.office_arch.Session`.
|
||||
"""
|
||||
from corepos.db.office_arch import Session
|
||||
|
||||
if 'bind' not in kwargs:
|
||||
kwargs['bind'] = self.config.core_office_arch_engines[dbkey]
|
||||
return Session(**kwargs)
|
||||
|
||||
def get_office_url(self, require=False):
|
||||
"""
|
||||
Returns the base URL for the CORE Office web app.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue