From e5988102ad13c03f5d516dca1245b3959fc852ef Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Thu, 5 Oct 2023 11:52:39 -0500 Subject: [PATCH] Rename module to `corepos.db.office_arch` --- corepos/db/office_arch/__init__.py | 30 ++++++++++++++++ corepos/db/office_arch/model.py | 39 +++++++++++++++++++++ corepos/db/office_trans_archive/__init__.py | 10 +++--- corepos/db/office_trans_archive/model.py | 17 +++------ 4 files changed, 80 insertions(+), 16 deletions(-) create mode 100644 corepos/db/office_arch/__init__.py create mode 100644 corepos/db/office_arch/model.py diff --git a/corepos/db/office_arch/__init__.py b/corepos/db/office_arch/__init__.py new file mode 100644 index 0000000..70292e9 --- /dev/null +++ b/corepos/db/office_arch/__init__.py @@ -0,0 +1,30 @@ +# -*- coding: utf-8; -*- +################################################################################ +# +# pyCOREPOS -- Python Interface to CORE POS +# Copyright © 2018-2023 Lance Edgar +# +# This file is part of pyCOREPOS. +# +# pyCOREPOS is free software: you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free +# Software Foundation, either version 3 of the License, or (at your option) +# any later version. +# +# pyCOREPOS is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +# details. +# +# You should have received a copy of the GNU General Public License along with +# pyCOREPOS. If not, see . +# +################################################################################ +""" +"Archive" Transaction Database Interface +""" + +from sqlalchemy import orm + + +Session = orm.sessionmaker() diff --git a/corepos/db/office_arch/model.py b/corepos/db/office_arch/model.py new file mode 100644 index 0000000..bf01a4d --- /dev/null +++ b/corepos/db/office_arch/model.py @@ -0,0 +1,39 @@ +# -*- coding: utf-8; -*- +################################################################################ +# +# pyCOREPOS -- Python Interface to CORE POS +# Copyright © 2018-2023 Lance Edgar +# +# This file is part of pyCOREPOS. +# +# pyCOREPOS is free software: you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free +# Software Foundation, either version 3 of the License, or (at your option) +# any later version. +# +# pyCOREPOS is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +# details. +# +# You should have received a copy of the GNU General Public License along with +# pyCOREPOS. If not, see . +# +################################################################################ +""" +CORE Office "arch" data model +""" + +from sqlalchemy import orm + +from corepos.db.office_trans.model import TransactionDetailBase + + +Base = orm.declarative_base() + + +class TransactionDetail(TransactionDetailBase, Base): + """ + Represents a POS transaction detail record. + """ + __tablename__ = 'bigArchive' diff --git a/corepos/db/office_trans_archive/__init__.py b/corepos/db/office_trans_archive/__init__.py index e25b200..6ddb31d 100644 --- a/corepos/db/office_trans_archive/__init__.py +++ b/corepos/db/office_trans_archive/__init__.py @@ -2,7 +2,7 @@ ################################################################################ # # pyCOREPOS -- Python Interface to CORE POS -# Copyright © 2018-2022 Lance Edgar +# Copyright © 2018-2023 Lance Edgar # # This file is part of pyCOREPOS. # @@ -24,7 +24,9 @@ "Archive" Transaction Database Interface """ -from sqlalchemy import orm +import warnings +warnings.warn("The `corepos.db.office_trans_archive` module is deprecated! " + "Please use `corepos.db.office_arch` instead.", + DeprecationWarning, stacklevel=2) - -Session = orm.sessionmaker() +from corepos.db.office_arch import * diff --git a/corepos/db/office_trans_archive/model.py b/corepos/db/office_trans_archive/model.py index 8f4a079..e57d071 100644 --- a/corepos/db/office_trans_archive/model.py +++ b/corepos/db/office_trans_archive/model.py @@ -24,16 +24,9 @@ CORE POS Transaction Data Model """ -from sqlalchemy import orm +import warnings +warnings.warn("The `corepos.db.office_trans_archive.model` module is deprecated! " + "Please use `corepos.db.office_arch.model` instead.", + DeprecationWarning, stacklevel=2) -from corepos.db.office_trans.model import TransactionDetailBase - - -Base = orm.declarative_base() - - -class TransactionDetail(TransactionDetailBase, Base): - """ - Represents a POS transaction detail record. - """ - __tablename__ = 'bigArchive' +from corepos.db.office_arch.model import *