Explicitly disable cascade_backrefs for all backrefs
				
					
				
			https://docs.sqlalchemy.org/en/20/changelog/migration_14.html#cascade-backrefs-behavior-deprecated-for-removal-in-2-0
This commit is contained in:
		
							parent
							
								
									bfd9f43080
								
							
						
					
					
						commit
						71f6ac0ef9
					
				
					 20 changed files with 135 additions and 152 deletions
				
			
		| 
						 | 
					@ -2,7 +2,7 @@
 | 
				
			||||||
################################################################################
 | 
					################################################################################
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
#  Rattail -- Retail Software Framework
 | 
					#  Rattail -- Retail Software Framework
 | 
				
			||||||
#  Copyright © 2010-2021 Lance Edgar
 | 
					#  Copyright © 2010-2023 Lance Edgar
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
#  This file is part of Rattail.
 | 
					#  This file is part of Rattail.
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
| 
						 | 
					@ -24,8 +24,6 @@
 | 
				
			||||||
Models for customer order batches
 | 
					Models for customer order batches
 | 
				
			||||||
"""
 | 
					"""
 | 
				
			||||||
 | 
					
 | 
				
			||||||
from __future__ import unicode_literals, absolute_import
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
import sqlalchemy as sa
 | 
					import sqlalchemy as sa
 | 
				
			||||||
from sqlalchemy import orm
 | 
					from sqlalchemy import orm
 | 
				
			||||||
from sqlalchemy.ext.declarative import declared_attr
 | 
					from sqlalchemy.ext.declarative import declared_attr
 | 
				
			||||||
| 
						 | 
					@ -68,6 +66,7 @@ class CustomerOrderBatch(BatchMixin, CustomerOrderBase, Base):
 | 
				
			||||||
        backref=orm.backref(
 | 
					        backref=orm.backref(
 | 
				
			||||||
            'batches',
 | 
					            'batches',
 | 
				
			||||||
            order_by='CustomerOrderBatch.id',
 | 
					            order_by='CustomerOrderBatch.id',
 | 
				
			||||||
 | 
					            cascade_backrefs=False,
 | 
				
			||||||
            doc="""
 | 
					            doc="""
 | 
				
			||||||
            List of batches associated with the customer order.
 | 
					            List of batches associated with the customer order.
 | 
				
			||||||
            """))
 | 
					            """))
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -2,7 +2,7 @@
 | 
				
			||||||
################################################################################
 | 
					################################################################################
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
#  Rattail -- Retail Software Framework
 | 
					#  Rattail -- Retail Software Framework
 | 
				
			||||||
#  Copyright © 2010-2021 Lance Edgar
 | 
					#  Copyright © 2010-2023 Lance Edgar
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
#  This file is part of Rattail.
 | 
					#  This file is part of Rattail.
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
| 
						 | 
					@ -24,8 +24,6 @@
 | 
				
			||||||
Model for inventory batches
 | 
					Model for inventory batches
 | 
				
			||||||
"""
 | 
					"""
 | 
				
			||||||
 | 
					
 | 
				
			||||||
from __future__ import unicode_literals, absolute_import
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
import sqlalchemy as sa
 | 
					import sqlalchemy as sa
 | 
				
			||||||
from sqlalchemy import orm
 | 
					from sqlalchemy import orm
 | 
				
			||||||
from sqlalchemy.ext.declarative import declared_attr
 | 
					from sqlalchemy.ext.declarative import declared_attr
 | 
				
			||||||
| 
						 | 
					@ -57,7 +55,11 @@ class InventoryBatch(BatchMixin, Base):
 | 
				
			||||||
        doc="""
 | 
					        doc="""
 | 
				
			||||||
        Reference to the handheld batch from which this inventory batch originated.
 | 
					        Reference to the handheld batch from which this inventory batch originated.
 | 
				
			||||||
        """,
 | 
					        """,
 | 
				
			||||||
        backref=orm.backref('inventory_batch', uselist=False, doc="""
 | 
					        backref=orm.backref(
 | 
				
			||||||
 | 
					            'inventory_batch',
 | 
				
			||||||
 | 
					            uselist=False,
 | 
				
			||||||
 | 
					            cascade_backrefs=False,
 | 
				
			||||||
 | 
					            doc="""
 | 
				
			||||||
            Reference to the inventory batch to which this handheld batch was converted.
 | 
					            Reference to the inventory batch to which this handheld batch was converted.
 | 
				
			||||||
            """))
 | 
					            """))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -103,6 +105,7 @@ class InventoryBatchFromHandheld(Base):
 | 
				
			||||||
            collection_class=ordering_list('ordinal', count_from=1),
 | 
					            collection_class=ordering_list('ordinal', count_from=1),
 | 
				
			||||||
            order_by=ordinal,
 | 
					            order_by=ordinal,
 | 
				
			||||||
            cascade='all, delete-orphan',
 | 
					            cascade='all, delete-orphan',
 | 
				
			||||||
 | 
					            cascade_backrefs=False,
 | 
				
			||||||
            doc="""
 | 
					            doc="""
 | 
				
			||||||
            Sequence of raw inventory / handheld batch associations.
 | 
					            Sequence of raw inventory / handheld batch associations.
 | 
				
			||||||
            """))
 | 
					            """))
 | 
				
			||||||
| 
						 | 
					@ -117,6 +120,7 @@ class InventoryBatchFromHandheld(Base):
 | 
				
			||||||
            '_inventory_batch',
 | 
					            '_inventory_batch',
 | 
				
			||||||
            uselist=False,
 | 
					            uselist=False,
 | 
				
			||||||
            cascade='all, delete-orphan',
 | 
					            cascade='all, delete-orphan',
 | 
				
			||||||
 | 
					            cascade_backrefs=False,
 | 
				
			||||||
            doc="""
 | 
					            doc="""
 | 
				
			||||||
            Indirect reference to the inventory batch to which this handheld batch was converted.
 | 
					            Indirect reference to the inventory batch to which this handheld batch was converted.
 | 
				
			||||||
            """))
 | 
					            """))
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -2,7 +2,7 @@
 | 
				
			||||||
################################################################################
 | 
					################################################################################
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
#  Rattail -- Retail Software Framework
 | 
					#  Rattail -- Retail Software Framework
 | 
				
			||||||
#  Copyright © 2010-2022 Lance Edgar
 | 
					#  Copyright © 2010-2023 Lance Edgar
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
#  This file is part of Rattail.
 | 
					#  This file is part of Rattail.
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
| 
						 | 
					@ -24,8 +24,6 @@
 | 
				
			||||||
Data model for label batches
 | 
					Data model for label batches
 | 
				
			||||||
"""
 | 
					"""
 | 
				
			||||||
 | 
					
 | 
				
			||||||
from __future__ import unicode_literals, absolute_import
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
import sqlalchemy as sa
 | 
					import sqlalchemy as sa
 | 
				
			||||||
from sqlalchemy import orm
 | 
					from sqlalchemy import orm
 | 
				
			||||||
from sqlalchemy.ext.declarative import declared_attr
 | 
					from sqlalchemy.ext.declarative import declared_attr
 | 
				
			||||||
| 
						 | 
					@ -65,6 +63,7 @@ class LabelBatch(BatchMixin, Base):
 | 
				
			||||||
        backref=orm.backref(
 | 
					        backref=orm.backref(
 | 
				
			||||||
            'label_batch',
 | 
					            'label_batch',
 | 
				
			||||||
            uselist=False,
 | 
					            uselist=False,
 | 
				
			||||||
 | 
					            cascade_backrefs=False,
 | 
				
			||||||
            doc="""
 | 
					            doc="""
 | 
				
			||||||
            Reference to the label batch to which this handheld batch was converted.
 | 
					            Reference to the label batch to which this handheld batch was converted.
 | 
				
			||||||
            """))
 | 
					            """))
 | 
				
			||||||
| 
						 | 
					@ -117,6 +116,7 @@ class LabelBatchFromHandheld(Base):
 | 
				
			||||||
            collection_class=ordering_list('ordinal', count_from=1),
 | 
					            collection_class=ordering_list('ordinal', count_from=1),
 | 
				
			||||||
            order_by=ordinal,
 | 
					            order_by=ordinal,
 | 
				
			||||||
            cascade='all, delete-orphan',
 | 
					            cascade='all, delete-orphan',
 | 
				
			||||||
 | 
					            cascade_backrefs=False,
 | 
				
			||||||
            doc="""
 | 
					            doc="""
 | 
				
			||||||
            Sequence of raw label / handheld batch associations.
 | 
					            Sequence of raw label / handheld batch associations.
 | 
				
			||||||
            """))
 | 
					            """))
 | 
				
			||||||
| 
						 | 
					@ -131,6 +131,7 @@ class LabelBatchFromHandheld(Base):
 | 
				
			||||||
            '_label_batch',
 | 
					            '_label_batch',
 | 
				
			||||||
            uselist=False,
 | 
					            uselist=False,
 | 
				
			||||||
            cascade='all, delete-orphan',
 | 
					            cascade='all, delete-orphan',
 | 
				
			||||||
 | 
					            cascade_backrefs=False,
 | 
				
			||||||
            doc="""
 | 
					            doc="""
 | 
				
			||||||
            Indirect reference to the label batch to which this handheld batch was converted.
 | 
					            Indirect reference to the label batch to which this handheld batch was converted.
 | 
				
			||||||
            """))
 | 
					            """))
 | 
				
			||||||
| 
						 | 
					@ -185,7 +186,10 @@ class LabelBatchRow(ProductBatchRowMixin, Base):
 | 
				
			||||||
        doc="""
 | 
					        doc="""
 | 
				
			||||||
        Reference to the :class:`LabelProfile` with which the row is associated.
 | 
					        Reference to the :class:`LabelProfile` with which the row is associated.
 | 
				
			||||||
        """,
 | 
					        """,
 | 
				
			||||||
        backref=orm.backref('_print_labels_rows', cascade='all'))
 | 
					        backref=orm.backref(
 | 
				
			||||||
 | 
					            '_print_labels_rows',
 | 
				
			||||||
 | 
					            cascade='all',
 | 
				
			||||||
 | 
					            cascade_backrefs=False))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    label_quantity = sa.Column(sa.Integer(), nullable=False, default=1, doc="""
 | 
					    label_quantity = sa.Column(sa.Integer(), nullable=False, default=1, doc="""
 | 
				
			||||||
    Number of labels to print for this row/product.
 | 
					    Number of labels to print for this row/product.
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -2,7 +2,7 @@
 | 
				
			||||||
################################################################################
 | 
					################################################################################
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
#  Rattail -- Retail Software Framework
 | 
					#  Rattail -- Retail Software Framework
 | 
				
			||||||
#  Copyright © 2010-2022 Lance Edgar
 | 
					#  Copyright © 2010-2023 Lance Edgar
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
#  This file is part of Rattail.
 | 
					#  This file is part of Rattail.
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
| 
						 | 
					@ -24,9 +24,6 @@
 | 
				
			||||||
Models for purchase order batches
 | 
					Models for purchase order batches
 | 
				
			||||||
"""
 | 
					"""
 | 
				
			||||||
 | 
					
 | 
				
			||||||
from __future__ import unicode_literals, absolute_import
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
import six
 | 
					 | 
				
			||||||
import sqlalchemy as sa
 | 
					import sqlalchemy as sa
 | 
				
			||||||
from sqlalchemy import orm
 | 
					from sqlalchemy import orm
 | 
				
			||||||
from sqlalchemy.ext.declarative import declared_attr
 | 
					from sqlalchemy.ext.declarative import declared_attr
 | 
				
			||||||
| 
						 | 
					@ -81,6 +78,7 @@ class PurchaseBatch(BatchMixin, PurchaseBase, Base):
 | 
				
			||||||
        backref=orm.backref(
 | 
					        backref=orm.backref(
 | 
				
			||||||
            'batches',
 | 
					            'batches',
 | 
				
			||||||
            order_by='PurchaseBatch.id',
 | 
					            order_by='PurchaseBatch.id',
 | 
				
			||||||
 | 
					            cascade_backrefs=False,
 | 
				
			||||||
            doc="""
 | 
					            doc="""
 | 
				
			||||||
            List of batches associated with the purchase.
 | 
					            List of batches associated with the purchase.
 | 
				
			||||||
            """))
 | 
					            """))
 | 
				
			||||||
| 
						 | 
					@ -155,6 +153,7 @@ class PurchaseBatch(BatchMixin, PurchaseBase, Base):
 | 
				
			||||||
        backref=orm.backref(
 | 
					        backref=orm.backref(
 | 
				
			||||||
            'truck_dump_children',
 | 
					            'truck_dump_children',
 | 
				
			||||||
            order_by='PurchaseBatch.id',
 | 
					            order_by='PurchaseBatch.id',
 | 
				
			||||||
 | 
					            cascade_backrefs=False,
 | 
				
			||||||
            doc="""
 | 
					            doc="""
 | 
				
			||||||
            List of batches which are "children" of the current batch, which is
 | 
					            List of batches which are "children" of the current batch, which is
 | 
				
			||||||
            assumed to be a truck dump.
 | 
					            assumed to be a truck dump.
 | 
				
			||||||
| 
						 | 
					@ -312,6 +311,7 @@ class PurchaseBatchRowClaim(Base):
 | 
				
			||||||
        backref=orm.backref(
 | 
					        backref=orm.backref(
 | 
				
			||||||
            'truck_dump_claims',
 | 
					            'truck_dump_claims',
 | 
				
			||||||
            cascade='all, delete-orphan',
 | 
					            cascade='all, delete-orphan',
 | 
				
			||||||
 | 
					            cascade_backrefs=False,
 | 
				
			||||||
            doc="""
 | 
					            doc="""
 | 
				
			||||||
            List of claims which this "child" row makes against rows within a
 | 
					            List of claims which this "child" row makes against rows within a
 | 
				
			||||||
            truck dump batch.
 | 
					            truck dump batch.
 | 
				
			||||||
| 
						 | 
					@ -327,6 +327,7 @@ class PurchaseBatchRowClaim(Base):
 | 
				
			||||||
        backref=orm.backref(
 | 
					        backref=orm.backref(
 | 
				
			||||||
            'claims',
 | 
					            'claims',
 | 
				
			||||||
            cascade='all, delete-orphan',
 | 
					            cascade='all, delete-orphan',
 | 
				
			||||||
 | 
					            cascade_backrefs=False,
 | 
				
			||||||
            doc="""
 | 
					            doc="""
 | 
				
			||||||
            List of claims made by "child" rows against this truck dump batch row.
 | 
					            List of claims made by "child" rows against this truck dump batch row.
 | 
				
			||||||
            """))
 | 
					            """))
 | 
				
			||||||
| 
						 | 
					@ -405,6 +406,7 @@ class PurchaseBatchCredit(PurchaseCreditBase, Base):
 | 
				
			||||||
        backref=orm.backref(
 | 
					        backref=orm.backref(
 | 
				
			||||||
            'credits',
 | 
					            'credits',
 | 
				
			||||||
            cascade='all, delete-orphan',
 | 
					            cascade='all, delete-orphan',
 | 
				
			||||||
 | 
					            cascade_backrefs=False,
 | 
				
			||||||
            doc="""
 | 
					            doc="""
 | 
				
			||||||
            List of :class:`PurchaseBatchCredit` instances for the row.
 | 
					            List of :class:`PurchaseBatchCredit` instances for the row.
 | 
				
			||||||
            """))
 | 
					            """))
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -2,7 +2,7 @@
 | 
				
			||||||
################################################################################
 | 
					################################################################################
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
#  Rattail -- Retail Software Framework
 | 
					#  Rattail -- Retail Software Framework
 | 
				
			||||||
#  Copyright © 2010-2021 Lance Edgar
 | 
					#  Copyright © 2010-2023 Lance Edgar
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
#  This file is part of Rattail.
 | 
					#  This file is part of Rattail.
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
| 
						 | 
					@ -24,8 +24,6 @@
 | 
				
			||||||
Models for vendor catalog batches
 | 
					Models for vendor catalog batches
 | 
				
			||||||
"""
 | 
					"""
 | 
				
			||||||
 | 
					
 | 
				
			||||||
from __future__ import unicode_literals, absolute_import
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
import sqlalchemy as sa
 | 
					import sqlalchemy as sa
 | 
				
			||||||
from sqlalchemy import orm
 | 
					from sqlalchemy import orm
 | 
				
			||||||
from sqlalchemy.ext.declarative import declared_attr
 | 
					from sqlalchemy.ext.declarative import declared_attr
 | 
				
			||||||
| 
						 | 
					@ -126,7 +124,9 @@ class VendorCatalogBatchRow(ProductBatchRowMixin, Base):
 | 
				
			||||||
        associated, if any.
 | 
					        associated, if any.
 | 
				
			||||||
        """,
 | 
					        """,
 | 
				
			||||||
        backref=orm.backref(
 | 
					        backref=orm.backref(
 | 
				
			||||||
            '_vendor_catalog_batch_rows', doc="""
 | 
					            '_vendor_catalog_batch_rows',
 | 
				
			||||||
 | 
					            cascade_backrefs=False,
 | 
				
			||||||
 | 
					            doc="""
 | 
				
			||||||
            List of vendor catalog batch rows which associate directly with
 | 
					            List of vendor catalog batch rows which associate directly with
 | 
				
			||||||
            this cost record.
 | 
					            this cost record.
 | 
				
			||||||
            """))
 | 
					            """))
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -2,7 +2,7 @@
 | 
				
			||||||
################################################################################
 | 
					################################################################################
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
#  Rattail -- Retail Software Framework
 | 
					#  Rattail -- Retail Software Framework
 | 
				
			||||||
#  Copyright © 2010-2022 Lance Edgar
 | 
					#  Copyright © 2010-2023 Lance Edgar
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
#  This file is part of Rattail.
 | 
					#  This file is part of Rattail.
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
| 
						 | 
					@ -24,11 +24,8 @@
 | 
				
			||||||
Data Models for Customers
 | 
					Data Models for Customers
 | 
				
			||||||
"""
 | 
					"""
 | 
				
			||||||
 | 
					
 | 
				
			||||||
from __future__ import unicode_literals, absolute_import
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
import datetime
 | 
					import datetime
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import six
 | 
					 | 
				
			||||||
import sqlalchemy as sa
 | 
					import sqlalchemy as sa
 | 
				
			||||||
from sqlalchemy import orm
 | 
					from sqlalchemy import orm
 | 
				
			||||||
from sqlalchemy.ext.associationproxy import association_proxy
 | 
					from sqlalchemy.ext.associationproxy import association_proxy
 | 
				
			||||||
| 
						 | 
					@ -86,12 +83,6 @@ class Customer(ContactMixin, Base):
 | 
				
			||||||
    """)
 | 
					    """)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def __str__(self):
 | 
					    def __str__(self):
 | 
				
			||||||
        if six.PY2:
 | 
					 | 
				
			||||||
            return unicode(self).encode('utf8')
 | 
					 | 
				
			||||||
        return self.name or ""
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    if six.PY2:
 | 
					 | 
				
			||||||
        def __unicode__(self):
 | 
					 | 
				
			||||||
        return self.name or ""
 | 
					        return self.name or ""
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def add_email_address(self, address, type='Home'):
 | 
					    def add_email_address(self, address, type='Home'):
 | 
				
			||||||
| 
						 | 
					@ -254,12 +245,12 @@ class CustomerNote(Note):
 | 
				
			||||||
            foreign_keys='CustomerNote.parent_uuid',
 | 
					            foreign_keys='CustomerNote.parent_uuid',
 | 
				
			||||||
            order_by='CustomerNote.created',
 | 
					            order_by='CustomerNote.created',
 | 
				
			||||||
            cascade='all, delete-orphan',
 | 
					            cascade='all, delete-orphan',
 | 
				
			||||||
 | 
					            cascade_backrefs=False,
 | 
				
			||||||
            doc="""
 | 
					            doc="""
 | 
				
			||||||
            Sequence of notes which belong to the customer.
 | 
					            Sequence of notes which belong to the customer.
 | 
				
			||||||
            """))
 | 
					            """))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@six.python_2_unicode_compatible
 | 
					 | 
				
			||||||
class CustomerGroup(Base):
 | 
					class CustomerGroup(Base):
 | 
				
			||||||
    """
 | 
					    """
 | 
				
			||||||
    Represents an arbitrary group to which customers may belong.
 | 
					    Represents an arbitrary group to which customers may belong.
 | 
				
			||||||
| 
						 | 
					@ -295,7 +286,8 @@ class CustomerGroupAssignment(Base):
 | 
				
			||||||
        CustomerGroup,
 | 
					        CustomerGroup,
 | 
				
			||||||
        backref=orm.backref(
 | 
					        backref=orm.backref(
 | 
				
			||||||
            '_customers',
 | 
					            '_customers',
 | 
				
			||||||
            cascade='all, delete-orphan'))
 | 
					            cascade='all, delete-orphan',
 | 
				
			||||||
 | 
					            cascade_backrefs=False))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Customer._groups = orm.relationship(
 | 
					Customer._groups = orm.relationship(
 | 
				
			||||||
| 
						 | 
					@ -421,10 +413,4 @@ class PendingCustomer(Base):
 | 
				
			||||||
    """)
 | 
					    """)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def __str__(self):
 | 
					    def __str__(self):
 | 
				
			||||||
        if six.PY2:
 | 
					 | 
				
			||||||
            return (self.display_name or "").encode('utf_8')
 | 
					 | 
				
			||||||
        return self.display_name or ""
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    if six.PY2:
 | 
					 | 
				
			||||||
        def __unicode__(self):
 | 
					 | 
				
			||||||
        return self.display_name or ""
 | 
					        return self.display_name or ""
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -2,7 +2,7 @@
 | 
				
			||||||
################################################################################
 | 
					################################################################################
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
#  Rattail -- Retail Software Framework
 | 
					#  Rattail -- Retail Software Framework
 | 
				
			||||||
#  Copyright © 2010-2021 Lance Edgar
 | 
					#  Copyright © 2010-2023 Lance Edgar
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
#  This file is part of Rattail.
 | 
					#  This file is part of Rattail.
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
| 
						 | 
					@ -24,11 +24,8 @@
 | 
				
			||||||
Data Models for Customer Orders
 | 
					Data Models for Customer Orders
 | 
				
			||||||
"""
 | 
					"""
 | 
				
			||||||
 | 
					
 | 
				
			||||||
from __future__ import unicode_literals, absolute_import
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
import datetime
 | 
					import datetime
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import six
 | 
					 | 
				
			||||||
import sqlalchemy as sa
 | 
					import sqlalchemy as sa
 | 
				
			||||||
from sqlalchemy import orm
 | 
					from sqlalchemy import orm
 | 
				
			||||||
from sqlalchemy.ext.orderinglist import ordering_list
 | 
					from sqlalchemy.ext.orderinglist import ordering_list
 | 
				
			||||||
| 
						 | 
					@ -123,7 +120,6 @@ class CustomerOrderBase(object):
 | 
				
			||||||
    """)
 | 
					    """)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@six.python_2_unicode_compatible
 | 
					 | 
				
			||||||
class CustomerOrder(CustomerOrderBase, Base):
 | 
					class CustomerOrder(CustomerOrderBase, Base):
 | 
				
			||||||
    """
 | 
					    """
 | 
				
			||||||
    Represents an order placed by the customer.
 | 
					    Represents an order placed by the customer.
 | 
				
			||||||
| 
						 | 
					@ -171,7 +167,6 @@ class CustomerOrder(CustomerOrderBase, Base):
 | 
				
			||||||
        return "(pending)"
 | 
					        return "(pending)"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@six.python_2_unicode_compatible
 | 
					 | 
				
			||||||
class CustomerOrderItemBase(object):
 | 
					class CustomerOrderItemBase(object):
 | 
				
			||||||
    """
 | 
					    """
 | 
				
			||||||
    Base class for customer order line items.
 | 
					    Base class for customer order line items.
 | 
				
			||||||
| 
						 | 
					@ -407,7 +402,8 @@ class CustomerOrderItemEvent(Base):
 | 
				
			||||||
        backref=orm.backref(
 | 
					        backref=orm.backref(
 | 
				
			||||||
            'events',
 | 
					            'events',
 | 
				
			||||||
            order_by='CustomerOrderItemEvent.occurred',
 | 
					            order_by='CustomerOrderItemEvent.occurred',
 | 
				
			||||||
            cascade='all, delete-orphan'))
 | 
					            cascade='all, delete-orphan',
 | 
				
			||||||
 | 
					            cascade_backrefs=False))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    type_code = sa.Column(sa.Integer, nullable=False)
 | 
					    type_code = sa.Column(sa.Integer, nullable=False)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -445,6 +441,7 @@ CustomerOrderItem.notes = orm.relationship(
 | 
				
			||||||
    """,
 | 
					    """,
 | 
				
			||||||
    backref=orm.backref(
 | 
					    backref=orm.backref(
 | 
				
			||||||
        'person',
 | 
					        'person',
 | 
				
			||||||
 | 
					        cascade_backrefs=False,
 | 
				
			||||||
        doc="""
 | 
					        doc="""
 | 
				
			||||||
        Reference to the order item to which the note is attached.
 | 
					        Reference to the order item to which the note is attached.
 | 
				
			||||||
        """))
 | 
					        """))
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -213,12 +213,18 @@ class EmployeeStore(Base):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    employee = orm.relationship(
 | 
					    employee = orm.relationship(
 | 
				
			||||||
        Employee,
 | 
					        Employee,
 | 
				
			||||||
        backref=orm.backref('_stores', cascade='all, delete-orphan'))
 | 
					        backref=orm.backref(
 | 
				
			||||||
 | 
					            '_stores',
 | 
				
			||||||
 | 
					            cascade='all, delete-orphan',
 | 
				
			||||||
 | 
					            cascade_backrefs=False))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    store = orm.relationship(
 | 
					    store = orm.relationship(
 | 
				
			||||||
        Store,
 | 
					        Store,
 | 
				
			||||||
        order_by=Store.name,
 | 
					        order_by=Store.name,
 | 
				
			||||||
        backref=orm.backref('_employees', cascade='all, delete-orphan'))
 | 
					        backref=orm.backref(
 | 
				
			||||||
 | 
					            '_employees',
 | 
				
			||||||
 | 
					            cascade='all, delete-orphan',
 | 
				
			||||||
 | 
					            cascade_backrefs=False))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Employee.stores = association_proxy(
 | 
					Employee.stores = association_proxy(
 | 
				
			||||||
    '_stores', 'store',
 | 
					    '_stores', 'store',
 | 
				
			||||||
| 
						 | 
					@ -248,12 +254,18 @@ class EmployeeDepartment(Base):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    employee = orm.relationship(
 | 
					    employee = orm.relationship(
 | 
				
			||||||
        Employee,
 | 
					        Employee,
 | 
				
			||||||
        backref=orm.backref('_departments', cascade='all, delete-orphan'))
 | 
					        backref=orm.backref(
 | 
				
			||||||
 | 
					            '_departments',
 | 
				
			||||||
 | 
					            cascade='all, delete-orphan',
 | 
				
			||||||
 | 
					            cascade_backrefs=False))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    department = orm.relationship(
 | 
					    department = orm.relationship(
 | 
				
			||||||
        Department,
 | 
					        Department,
 | 
				
			||||||
        order_by=Department.name,
 | 
					        order_by=Department.name,
 | 
				
			||||||
        backref=orm.backref('_employees', cascade='all, delete-orphan'))
 | 
					        backref=orm.backref(
 | 
				
			||||||
 | 
					            '_employees',
 | 
				
			||||||
 | 
					            cascade='all, delete-orphan',
 | 
				
			||||||
 | 
					            cascade_backrefs=False))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Employee.departments = association_proxy(
 | 
					Employee.departments = association_proxy(
 | 
				
			||||||
    '_departments', 'department',
 | 
					    '_departments', 'department',
 | 
				
			||||||
| 
						 | 
					@ -286,6 +298,7 @@ class EmployeeHistory(Base):
 | 
				
			||||||
        backref=orm.backref(
 | 
					        backref=orm.backref(
 | 
				
			||||||
            'history',
 | 
					            'history',
 | 
				
			||||||
            order_by='EmployeeHistory.start_date',
 | 
					            order_by='EmployeeHistory.start_date',
 | 
				
			||||||
 | 
					            cascade_backrefs=False,
 | 
				
			||||||
            doc="""
 | 
					            doc="""
 | 
				
			||||||
            Sequence of history records for the employee.
 | 
					            Sequence of history records for the employee.
 | 
				
			||||||
            """))
 | 
					            """))
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -2,7 +2,7 @@
 | 
				
			||||||
################################################################################
 | 
					################################################################################
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
#  Rattail -- Retail Software Framework
 | 
					#  Rattail -- Retail Software Framework
 | 
				
			||||||
#  Copyright © 2010-2020 Lance Edgar
 | 
					#  Copyright © 2010-2023 Lance Edgar
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
#  This file is part of Rattail.
 | 
					#  This file is part of Rattail.
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
| 
						 | 
					@ -24,9 +24,6 @@
 | 
				
			||||||
Data Models for Members
 | 
					Data Models for Members
 | 
				
			||||||
"""
 | 
					"""
 | 
				
			||||||
 | 
					
 | 
				
			||||||
from __future__ import unicode_literals, absolute_import
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
import six
 | 
					 | 
				
			||||||
import sqlalchemy as sa
 | 
					import sqlalchemy as sa
 | 
				
			||||||
from sqlalchemy import orm
 | 
					from sqlalchemy import orm
 | 
				
			||||||
from sqlalchemy.ext.orderinglist import ordering_list
 | 
					from sqlalchemy.ext.orderinglist import ordering_list
 | 
				
			||||||
| 
						 | 
					@ -69,6 +66,7 @@ class Member(ContactMixin, Base):
 | 
				
			||||||
        """,
 | 
					        """,
 | 
				
			||||||
        backref=orm.backref(
 | 
					        backref=orm.backref(
 | 
				
			||||||
            'members',
 | 
					            'members',
 | 
				
			||||||
 | 
					            cascade_backrefs=False,
 | 
				
			||||||
            doc="""
 | 
					            doc="""
 | 
				
			||||||
            Sequence of member records with which this person is associated.
 | 
					            Sequence of member records with which this person is associated.
 | 
				
			||||||
            """),
 | 
					            """),
 | 
				
			||||||
| 
						 | 
					@ -82,6 +80,7 @@ class Member(ContactMixin, Base):
 | 
				
			||||||
        """,
 | 
					        """,
 | 
				
			||||||
        backref=orm.backref(
 | 
					        backref=orm.backref(
 | 
				
			||||||
            'members',
 | 
					            'members',
 | 
				
			||||||
 | 
					            cascade_backrefs=False,
 | 
				
			||||||
            doc="""
 | 
					            doc="""
 | 
				
			||||||
            Sequence of member records with which this customer is associated.
 | 
					            Sequence of member records with which this customer is associated.
 | 
				
			||||||
            """),
 | 
					            """),
 | 
				
			||||||
| 
						 | 
					@ -126,14 +125,8 @@ class Member(ContactMixin, Base):
 | 
				
			||||||
    """)
 | 
					    """)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def __str__(self):
 | 
					    def __str__(self):
 | 
				
			||||||
        if six.PY2:
 | 
					 | 
				
			||||||
            return unicode(self).encode('utf_8')
 | 
					 | 
				
			||||||
        return str(self.person or self.customer or "")
 | 
					        return str(self.person or self.customer or "")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if six.PY2:
 | 
					 | 
				
			||||||
        def __unicode__(self):
 | 
					 | 
				
			||||||
            return unicode(self.person or self.customer or "")
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    # TODO: deprecate / remove this
 | 
					    # TODO: deprecate / remove this
 | 
				
			||||||
    def add_email_address(self, address, type='Home'):
 | 
					    def add_email_address(self, address, type='Home'):
 | 
				
			||||||
        email = MemberEmailAddress(address=address, type=type)
 | 
					        email = MemberEmailAddress(address=address, type=type)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -2,7 +2,7 @@
 | 
				
			||||||
################################################################################
 | 
					################################################################################
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
#  Rattail -- Retail Software Framework
 | 
					#  Rattail -- Retail Software Framework
 | 
				
			||||||
#  Copyright © 2010-2018 Lance Edgar
 | 
					#  Copyright © 2010-2023 Lance Edgar
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
#  This file is part of Rattail.
 | 
					#  This file is part of Rattail.
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
| 
						 | 
					@ -24,11 +24,8 @@
 | 
				
			||||||
Data Models for User Messages
 | 
					Data Models for User Messages
 | 
				
			||||||
"""
 | 
					"""
 | 
				
			||||||
 | 
					
 | 
				
			||||||
from __future__ import unicode_literals, absolute_import
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
import datetime
 | 
					import datetime
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import six
 | 
					 | 
				
			||||||
import sqlalchemy as sa
 | 
					import sqlalchemy as sa
 | 
				
			||||||
from sqlalchemy import orm
 | 
					from sqlalchemy import orm
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -52,7 +49,11 @@ class Message(Base):
 | 
				
			||||||
        User, doc="""
 | 
					        User, doc="""
 | 
				
			||||||
        Reference to the user who sent the message.
 | 
					        Reference to the user who sent the message.
 | 
				
			||||||
        """,
 | 
					        """,
 | 
				
			||||||
        backref=orm.backref('sent_messages', cascade='all, delete-orphan', doc="""
 | 
					        backref=orm.backref(
 | 
				
			||||||
 | 
					            'sent_messages',
 | 
				
			||||||
 | 
					            cascade='all, delete-orphan',
 | 
				
			||||||
 | 
					            cascade_backrefs=False,
 | 
				
			||||||
 | 
					            doc="""
 | 
				
			||||||
            List of all messages which have ever been sent by the user.
 | 
					            List of all messages which have ever been sent by the user.
 | 
				
			||||||
            """))
 | 
					            """))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -69,12 +70,6 @@ class Message(Base):
 | 
				
			||||||
    """)
 | 
					    """)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def __str__(self):
 | 
					    def __str__(self):
 | 
				
			||||||
        if six.PY2:
 | 
					 | 
				
			||||||
            return (self.subject or '').encode('utf8')
 | 
					 | 
				
			||||||
        return (self.subject or '')
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    if six.PY2:
 | 
					 | 
				
			||||||
        def __unicode__(self):
 | 
					 | 
				
			||||||
        return (self.subject or '')
 | 
					        return (self.subject or '')
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def add_recipient(self, user, **kwargs):
 | 
					    def add_recipient(self, user, **kwargs):
 | 
				
			||||||
| 
						 | 
					@ -97,7 +92,6 @@ class Message(Base):
 | 
				
			||||||
        return False
 | 
					        return False
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@six.python_2_unicode_compatible
 | 
					 | 
				
			||||||
class MessageRecipient(Base):
 | 
					class MessageRecipient(Base):
 | 
				
			||||||
    """
 | 
					    """
 | 
				
			||||||
    Represents the combination of a single message and a single recipient.
 | 
					    Represents the combination of a single message and a single recipient.
 | 
				
			||||||
| 
						 | 
					@ -123,16 +117,21 @@ class MessageRecipient(Base):
 | 
				
			||||||
        Message, doc="""
 | 
					        Message, doc="""
 | 
				
			||||||
        Reference to the message which has been "received".
 | 
					        Reference to the message which has been "received".
 | 
				
			||||||
        """,
 | 
					        """,
 | 
				
			||||||
        backref=orm.backref('recipients', cascade='all, delete-orphan', doc="""
 | 
					        backref=orm.backref(
 | 
				
			||||||
 | 
					            'recipients',
 | 
				
			||||||
 | 
					            cascade='all, delete-orphan',
 | 
				
			||||||
 | 
					            cascade_backrefs=False,
 | 
				
			||||||
 | 
					            doc="""
 | 
				
			||||||
            List of recipients for the message.
 | 
					            List of recipients for the message.
 | 
				
			||||||
        """,
 | 
					            """))
 | 
				
			||||||
        ))
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
    recipient = orm.relationship(
 | 
					    recipient = orm.relationship(
 | 
				
			||||||
        User, doc="""
 | 
					        User, doc="""
 | 
				
			||||||
        Reference to the user who "received" the message.
 | 
					        Reference to the user who "received" the message.
 | 
				
			||||||
        """,
 | 
					        """,
 | 
				
			||||||
        backref=orm.backref('_messages'))
 | 
					        backref=orm.backref(
 | 
				
			||||||
 | 
					            '_messages',
 | 
				
			||||||
 | 
					            cascade_backrefs=False))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def __str__(self):
 | 
					    def __str__(self):
 | 
				
			||||||
        return str(self.recipient)
 | 
					        return str(self.recipient)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -158,6 +158,7 @@ Person.phones = orm.relationship(
 | 
				
			||||||
    """,
 | 
					    """,
 | 
				
			||||||
    backref=orm.backref(
 | 
					    backref=orm.backref(
 | 
				
			||||||
        'person',
 | 
					        'person',
 | 
				
			||||||
 | 
					        cascade_backrefs=False,
 | 
				
			||||||
        doc="""
 | 
					        doc="""
 | 
				
			||||||
        Reference to the :class:`Person` instance to which the phone number
 | 
					        Reference to the :class:`Person` instance to which the phone number
 | 
				
			||||||
        belongs.
 | 
					        belongs.
 | 
				
			||||||
| 
						 | 
					@ -197,6 +198,7 @@ Person.emails = orm.relationship(
 | 
				
			||||||
    """,
 | 
					    """,
 | 
				
			||||||
    backref=orm.backref(
 | 
					    backref=orm.backref(
 | 
				
			||||||
        'person',
 | 
					        'person',
 | 
				
			||||||
 | 
					        cascade_backrefs=False,
 | 
				
			||||||
        doc="""
 | 
					        doc="""
 | 
				
			||||||
        Reference to the :class:`Person` instance to which the email address
 | 
					        Reference to the :class:`Person` instance to which the email address
 | 
				
			||||||
        belongs.
 | 
					        belongs.
 | 
				
			||||||
| 
						 | 
					@ -261,6 +263,7 @@ Person.notes = orm.relationship(
 | 
				
			||||||
    """,
 | 
					    """,
 | 
				
			||||||
    backref=orm.backref(
 | 
					    backref=orm.backref(
 | 
				
			||||||
        'person',
 | 
					        'person',
 | 
				
			||||||
 | 
					        cascade_backrefs=False,
 | 
				
			||||||
        doc="""
 | 
					        doc="""
 | 
				
			||||||
        Reference to the person to which the note is attached.
 | 
					        Reference to the person to which the note is attached.
 | 
				
			||||||
        """))
 | 
					        """))
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -2,7 +2,7 @@
 | 
				
			||||||
################################################################################
 | 
					################################################################################
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
#  Rattail -- Retail Software Framework
 | 
					#  Rattail -- Retail Software Framework
 | 
				
			||||||
#  Copyright © 2010-2022 Lance Edgar
 | 
					#  Copyright © 2010-2023 Lance Edgar
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
#  This file is part of Rattail.
 | 
					#  This file is part of Rattail.
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
| 
						 | 
					@ -24,12 +24,9 @@
 | 
				
			||||||
Data Models for Products
 | 
					Data Models for Products
 | 
				
			||||||
"""
 | 
					"""
 | 
				
			||||||
 | 
					
 | 
				
			||||||
from __future__ import unicode_literals, absolute_import
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
import datetime
 | 
					import datetime
 | 
				
			||||||
import logging
 | 
					import logging
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import six
 | 
					 | 
				
			||||||
import sqlalchemy as sa
 | 
					import sqlalchemy as sa
 | 
				
			||||||
from sqlalchemy import orm
 | 
					from sqlalchemy import orm
 | 
				
			||||||
from sqlalchemy.ext.orderinglist import ordering_list
 | 
					from sqlalchemy.ext.orderinglist import ordering_list
 | 
				
			||||||
| 
						 | 
					@ -47,7 +44,6 @@ from rattail.util import pretty_quantity
 | 
				
			||||||
log = logging.getLogger(__name__)
 | 
					log = logging.getLogger(__name__)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@six.python_2_unicode_compatible
 | 
					 | 
				
			||||||
class UnitOfMeasure(Base):
 | 
					class UnitOfMeasure(Base):
 | 
				
			||||||
    """
 | 
					    """
 | 
				
			||||||
    Maps a UOM abbreviation used by the organization, to the proper UOM code
 | 
					    Maps a UOM abbreviation used by the organization, to the proper UOM code
 | 
				
			||||||
| 
						 | 
					@ -106,16 +102,8 @@ class Brand(Base):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def __str__(self):
 | 
					    def __str__(self):
 | 
				
			||||||
        text = self.name or ''
 | 
					        text = self.name or ''
 | 
				
			||||||
        if six.PY2:
 | 
					 | 
				
			||||||
            return text.encode('utf8')
 | 
					 | 
				
			||||||
        return text
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    if six.PY2:
 | 
					 | 
				
			||||||
        def __unicode__(self):
 | 
					 | 
				
			||||||
            return self.name or ''
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@six.python_2_unicode_compatible
 | 
					 | 
				
			||||||
class Tax(Base):
 | 
					class Tax(Base):
 | 
				
			||||||
    """
 | 
					    """
 | 
				
			||||||
    Represents a sales tax rate to be applied to products.
 | 
					    Represents a sales tax rate to be applied to products.
 | 
				
			||||||
| 
						 | 
					@ -267,6 +255,7 @@ class Product(Base):
 | 
				
			||||||
        """,
 | 
					        """,
 | 
				
			||||||
        backref=orm.backref(
 | 
					        backref=orm.backref(
 | 
				
			||||||
            'packs',
 | 
					            'packs',
 | 
				
			||||||
 | 
					            cascade_backrefs=False,
 | 
				
			||||||
            doc="""
 | 
					            doc="""
 | 
				
			||||||
            List of products which reference the current product as their unit.
 | 
					            List of products which reference the current product as their unit.
 | 
				
			||||||
            """))
 | 
					            """))
 | 
				
			||||||
| 
						 | 
					@ -392,11 +381,15 @@ class Product(Base):
 | 
				
			||||||
    subdepartment = orm.relationship(
 | 
					    subdepartment = orm.relationship(
 | 
				
			||||||
        Subdepartment,
 | 
					        Subdepartment,
 | 
				
			||||||
        order_by=Subdepartment.name,
 | 
					        order_by=Subdepartment.name,
 | 
				
			||||||
        backref=orm.backref('products'))
 | 
					        backref=orm.backref(
 | 
				
			||||||
 | 
					            'products',
 | 
				
			||||||
 | 
					            cascade_backrefs=False))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    category = orm.relationship(
 | 
					    category = orm.relationship(
 | 
				
			||||||
        Category,
 | 
					        Category,
 | 
				
			||||||
        backref=orm.backref('products'))
 | 
					        backref=orm.backref(
 | 
				
			||||||
 | 
					            'products',
 | 
				
			||||||
 | 
					            cascade_backrefs=False))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    brand = orm.relationship(
 | 
					    brand = orm.relationship(
 | 
				
			||||||
        Brand,
 | 
					        Brand,
 | 
				
			||||||
| 
						 | 
					@ -405,6 +398,7 @@ class Product(Base):
 | 
				
			||||||
        """,
 | 
					        """,
 | 
				
			||||||
        backref=orm.backref(
 | 
					        backref=orm.backref(
 | 
				
			||||||
            'products',
 | 
					            'products',
 | 
				
			||||||
 | 
					            cascade_backrefs=False,
 | 
				
			||||||
            doc="""
 | 
					            doc="""
 | 
				
			||||||
            List of products for the brand.
 | 
					            List of products for the brand.
 | 
				
			||||||
            """))
 | 
					            """))
 | 
				
			||||||
| 
						 | 
					@ -417,6 +411,7 @@ class Product(Base):
 | 
				
			||||||
        """,
 | 
					        """,
 | 
				
			||||||
        backref=orm.backref(
 | 
					        backref=orm.backref(
 | 
				
			||||||
            'products',
 | 
					            'products',
 | 
				
			||||||
 | 
					            cascade_backrefs=False,
 | 
				
			||||||
            doc="""
 | 
					            doc="""
 | 
				
			||||||
            List of :class:`Product` objects which belong to this family.
 | 
					            List of :class:`Product` objects which belong to this family.
 | 
				
			||||||
            """))
 | 
					            """))
 | 
				
			||||||
| 
						 | 
					@ -429,17 +424,12 @@ class Product(Base):
 | 
				
			||||||
        """,
 | 
					        """,
 | 
				
			||||||
        backref=orm.backref(
 | 
					        backref=orm.backref(
 | 
				
			||||||
            'products',
 | 
					            'products',
 | 
				
			||||||
 | 
					            cascade_backrefs=False,
 | 
				
			||||||
            doc="""
 | 
					            doc="""
 | 
				
			||||||
            List of :class:`Product` objects which associate with this report code.
 | 
					            List of :class:`Product` objects which associate with this report code.
 | 
				
			||||||
            """))
 | 
					            """))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def __str__(self):
 | 
					    def __str__(self):
 | 
				
			||||||
        if six.PY2:
 | 
					 | 
				
			||||||
            return self.full_description.encode('utf8')
 | 
					 | 
				
			||||||
        return self.full_description
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    if six.PY2:
 | 
					 | 
				
			||||||
        def __unicode__(self):
 | 
					 | 
				
			||||||
        return self.full_description
 | 
					        return self.full_description
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    @property
 | 
					    @property
 | 
				
			||||||
| 
						 | 
					@ -552,6 +542,7 @@ class ProductImage(Base):
 | 
				
			||||||
        backref=orm.backref(
 | 
					        backref=orm.backref(
 | 
				
			||||||
            'image',
 | 
					            'image',
 | 
				
			||||||
            uselist=False,
 | 
					            uselist=False,
 | 
				
			||||||
 | 
					            cascade_backrefs=False,
 | 
				
			||||||
            doc="""
 | 
					            doc="""
 | 
				
			||||||
            Reference to the product's image, if any.
 | 
					            Reference to the product's image, if any.
 | 
				
			||||||
            """))
 | 
					            """))
 | 
				
			||||||
| 
						 | 
					@ -559,7 +550,6 @@ class ProductImage(Base):
 | 
				
			||||||
    bytes = sa.Column(sa.LargeBinary(), nullable=False)
 | 
					    bytes = sa.Column(sa.LargeBinary(), nullable=False)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@six.python_2_unicode_compatible
 | 
					 | 
				
			||||||
class ProductCode(Base):
 | 
					class ProductCode(Base):
 | 
				
			||||||
    """
 | 
					    """
 | 
				
			||||||
    Represents an arbitrary "code" for a product.
 | 
					    Represents an arbitrary "code" for a product.
 | 
				
			||||||
| 
						 | 
					@ -681,7 +671,10 @@ class ProductCost(Base):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    vendor = orm.relationship(
 | 
					    vendor = orm.relationship(
 | 
				
			||||||
        Vendor,
 | 
					        Vendor,
 | 
				
			||||||
        backref=orm.backref('product_costs', cascade='all'))
 | 
					        backref=orm.backref(
 | 
				
			||||||
 | 
					            'product_costs',
 | 
				
			||||||
 | 
					            cascade='all',
 | 
				
			||||||
 | 
					            cascade_backrefs=False))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Product.costs = orm.relationship(
 | 
					Product.costs = orm.relationship(
 | 
				
			||||||
| 
						 | 
					@ -738,7 +731,9 @@ class ProductFutureCost(Base):
 | 
				
			||||||
        will be applied (when the time comes), if applicable.  If this is
 | 
					        will be applied (when the time comes), if applicable.  If this is
 | 
				
			||||||
        ``None``, then a new "current" cost record would be created instead.
 | 
					        ``None``, then a new "current" cost record would be created instead.
 | 
				
			||||||
        """,
 | 
					        """,
 | 
				
			||||||
        backref=orm.backref('futures'))
 | 
					        backref=orm.backref(
 | 
				
			||||||
 | 
					            'futures',
 | 
				
			||||||
 | 
					            cascade_backrefs=False))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    product_uuid = sa.Column(sa.String(length=32), nullable=False)
 | 
					    product_uuid = sa.Column(sa.String(length=32), nullable=False)
 | 
				
			||||||
    product = orm.relationship(
 | 
					    product = orm.relationship(
 | 
				
			||||||
| 
						 | 
					@ -748,6 +743,7 @@ class ProductFutureCost(Base):
 | 
				
			||||||
        """,
 | 
					        """,
 | 
				
			||||||
        backref=orm.backref(
 | 
					        backref=orm.backref(
 | 
				
			||||||
            'future_costs',
 | 
					            'future_costs',
 | 
				
			||||||
 | 
					            cascade_backrefs=False,
 | 
				
			||||||
            doc="""
 | 
					            doc="""
 | 
				
			||||||
            Sequence of future cost records for the product, i.e. which have
 | 
					            Sequence of future cost records for the product, i.e. which have
 | 
				
			||||||
            yet to become "current" costs.
 | 
					            yet to become "current" costs.
 | 
				
			||||||
| 
						 | 
					@ -761,6 +757,7 @@ class ProductFutureCost(Base):
 | 
				
			||||||
        """,
 | 
					        """,
 | 
				
			||||||
        backref=orm.backref(
 | 
					        backref=orm.backref(
 | 
				
			||||||
            'future_costs',
 | 
					            'future_costs',
 | 
				
			||||||
 | 
					            cascade_backrefs=False,
 | 
				
			||||||
            doc="""
 | 
					            doc="""
 | 
				
			||||||
            Sequence of future cost records for the vendor, i.e. which have yet
 | 
					            Sequence of future cost records for the vendor, i.e. which have yet
 | 
				
			||||||
            to become "current" costs.
 | 
					            to become "current" costs.
 | 
				
			||||||
| 
						 | 
					@ -888,6 +885,7 @@ class ProductInventory(Base):
 | 
				
			||||||
            'inventory',
 | 
					            'inventory',
 | 
				
			||||||
            uselist=False,
 | 
					            uselist=False,
 | 
				
			||||||
            cascade='all, delete-orphan',
 | 
					            cascade='all, delete-orphan',
 | 
				
			||||||
 | 
					            cascade_backrefs=False,
 | 
				
			||||||
            doc="""
 | 
					            doc="""
 | 
				
			||||||
            Inventory data for the product, if any.
 | 
					            Inventory data for the product, if any.
 | 
				
			||||||
            """))
 | 
					            """))
 | 
				
			||||||
| 
						 | 
					@ -923,6 +921,7 @@ class ProductStoreInfo(Base):
 | 
				
			||||||
            'store_infos',
 | 
					            'store_infos',
 | 
				
			||||||
            collection_class=attribute_mapped_collection('store_uuid'),
 | 
					            collection_class=attribute_mapped_collection('store_uuid'),
 | 
				
			||||||
            cascade='all, delete-orphan',
 | 
					            cascade='all, delete-orphan',
 | 
				
			||||||
 | 
					            cascade_backrefs=False,
 | 
				
			||||||
            doc="""
 | 
					            doc="""
 | 
				
			||||||
            List of store-specific info records for the product.
 | 
					            List of store-specific info records for the product.
 | 
				
			||||||
            """))
 | 
					            """))
 | 
				
			||||||
| 
						 | 
					@ -969,6 +968,7 @@ class ProductVolatile(Base):
 | 
				
			||||||
            'volatile',
 | 
					            'volatile',
 | 
				
			||||||
            uselist=False,
 | 
					            uselist=False,
 | 
				
			||||||
            cascade='all, delete-orphan',
 | 
					            cascade='all, delete-orphan',
 | 
				
			||||||
 | 
					            cascade_backrefs=False,
 | 
				
			||||||
            doc="""
 | 
					            doc="""
 | 
				
			||||||
            "Volatile" data record for the product, if any.
 | 
					            "Volatile" data record for the product, if any.
 | 
				
			||||||
            """))
 | 
					            """))
 | 
				
			||||||
| 
						 | 
					@ -1057,16 +1057,9 @@ class PendingProduct(Base):
 | 
				
			||||||
                                     self.size)
 | 
					                                     self.size)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def __str__(self):
 | 
					    def __str__(self):
 | 
				
			||||||
        if six.PY2:
 | 
					 | 
				
			||||||
            return self.full_description.encode('utf8')
 | 
					 | 
				
			||||||
        return self.full_description
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    if six.PY2:
 | 
					 | 
				
			||||||
        def __unicode__(self):
 | 
					 | 
				
			||||||
        return self.full_description
 | 
					        return self.full_description
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@six.python_2_unicode_compatible
 | 
					 | 
				
			||||||
class InventoryAdjustmentReason(Base):
 | 
					class InventoryAdjustmentReason(Base):
 | 
				
			||||||
    """
 | 
					    """
 | 
				
			||||||
    Reasons for adjusting product inventory.
 | 
					    Reasons for adjusting product inventory.
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -24,11 +24,8 @@
 | 
				
			||||||
Data model for purchase orders
 | 
					Data model for purchase orders
 | 
				
			||||||
"""
 | 
					"""
 | 
				
			||||||
 | 
					
 | 
				
			||||||
from __future__ import unicode_literals, absolute_import
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
import datetime
 | 
					import datetime
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import six
 | 
					 | 
				
			||||||
import sqlalchemy as sa
 | 
					import sqlalchemy as sa
 | 
				
			||||||
from sqlalchemy import orm
 | 
					from sqlalchemy import orm
 | 
				
			||||||
from sqlalchemy.ext.declarative import declared_attr
 | 
					from sqlalchemy.ext.declarative import declared_attr
 | 
				
			||||||
| 
						 | 
					@ -38,7 +35,6 @@ from rattail.db.types import GPCType
 | 
				
			||||||
from rattail.util import pretty_quantity
 | 
					from rattail.util import pretty_quantity
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@six.python_2_unicode_compatible
 | 
					 | 
				
			||||||
class PurchaseBase(object):
 | 
					class PurchaseBase(object):
 | 
				
			||||||
    """
 | 
					    """
 | 
				
			||||||
    Base class for purchases; defines common fields.
 | 
					    Base class for purchases; defines common fields.
 | 
				
			||||||
| 
						 | 
					@ -321,7 +317,6 @@ class PurchaseItemBase(object):
 | 
				
			||||||
    """)
 | 
					    """)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@six.python_2_unicode_compatible
 | 
					 | 
				
			||||||
class PurchaseCreditBase(object):
 | 
					class PurchaseCreditBase(object):
 | 
				
			||||||
    """
 | 
					    """
 | 
				
			||||||
    Base class for purchase credits.
 | 
					    Base class for purchase credits.
 | 
				
			||||||
| 
						 | 
					@ -584,6 +579,7 @@ class PurchaseItem(PurchaseItemBase, Base):
 | 
				
			||||||
        backref=orm.backref(
 | 
					        backref=orm.backref(
 | 
				
			||||||
            'items',
 | 
					            'items',
 | 
				
			||||||
            cascade='all',
 | 
					            cascade='all',
 | 
				
			||||||
 | 
					            cascade_backrefs=False,
 | 
				
			||||||
            doc="""
 | 
					            doc="""
 | 
				
			||||||
            List of :class:`PurchaseItem` instances for the purchase.
 | 
					            List of :class:`PurchaseItem` instances for the purchase.
 | 
				
			||||||
            """))
 | 
					            """))
 | 
				
			||||||
| 
						 | 
					@ -618,6 +614,7 @@ class PurchaseCredit(PurchaseCreditBase, Base):
 | 
				
			||||||
        """,
 | 
					        """,
 | 
				
			||||||
        backref=orm.backref(
 | 
					        backref=orm.backref(
 | 
				
			||||||
            'credits',
 | 
					            'credits',
 | 
				
			||||||
 | 
					            cascade_backrefs=False,
 | 
				
			||||||
            doc="""
 | 
					            doc="""
 | 
				
			||||||
            List of :class:`PurchaseCredit` instances for the purchase.
 | 
					            List of :class:`PurchaseCredit` instances for the purchase.
 | 
				
			||||||
            """))
 | 
					            """))
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -2,7 +2,7 @@
 | 
				
			||||||
################################################################################
 | 
					################################################################################
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
#  Rattail -- Retail Software Framework
 | 
					#  Rattail -- Retail Software Framework
 | 
				
			||||||
#  Copyright © 2010-2017 Lance Edgar
 | 
					#  Copyright © 2010-2023 Lance Edgar
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
#  This file is part of Rattail.
 | 
					#  This file is part of Rattail.
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
| 
						 | 
					@ -24,10 +24,6 @@
 | 
				
			||||||
Data models for employee work shifts
 | 
					Data models for employee work shifts
 | 
				
			||||||
"""
 | 
					"""
 | 
				
			||||||
 | 
					
 | 
				
			||||||
from __future__ import unicode_literals, absolute_import
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
import six
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
import sqlalchemy as sa
 | 
					import sqlalchemy as sa
 | 
				
			||||||
from sqlalchemy import orm
 | 
					from sqlalchemy import orm
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -90,7 +86,10 @@ class ScheduledShift(Base, ShiftMixin):
 | 
				
			||||||
        Reference to the :class:`rattail.db.model.Employee` instance whose
 | 
					        Reference to the :class:`rattail.db.model.Employee` instance whose
 | 
				
			||||||
        shift this is.
 | 
					        shift this is.
 | 
				
			||||||
        """,
 | 
					        """,
 | 
				
			||||||
        backref=orm.backref('scheduled_shifts', doc="""
 | 
					        backref=orm.backref(
 | 
				
			||||||
 | 
					            'scheduled_shifts',
 | 
				
			||||||
 | 
					            cascade_backrefs=False,
 | 
				
			||||||
 | 
					            doc="""
 | 
				
			||||||
            Sequence of :class:`rattail.db.model.ScheduledShift` instances for the
 | 
					            Sequence of :class:`rattail.db.model.ScheduledShift` instances for the
 | 
				
			||||||
            employee.
 | 
					            employee.
 | 
				
			||||||
            """))
 | 
					            """))
 | 
				
			||||||
| 
						 | 
					@ -113,7 +112,6 @@ class ScheduledShift(Base, ShiftMixin):
 | 
				
			||||||
    """)
 | 
					    """)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@six.python_2_unicode_compatible
 | 
					 | 
				
			||||||
class WorkedShift(Base, ShiftMixin):
 | 
					class WorkedShift(Base, ShiftMixin):
 | 
				
			||||||
    """
 | 
					    """
 | 
				
			||||||
    Represents a shift actually *worked* by an employee.  (Either ``punch_in``
 | 
					    Represents a shift actually *worked* by an employee.  (Either ``punch_in``
 | 
				
			||||||
| 
						 | 
					@ -136,7 +134,10 @@ class WorkedShift(Base, ShiftMixin):
 | 
				
			||||||
        Reference to the :class:`rattail.db.model.Employee` instance whose
 | 
					        Reference to the :class:`rattail.db.model.Employee` instance whose
 | 
				
			||||||
        shift this is.
 | 
					        shift this is.
 | 
				
			||||||
        """,
 | 
					        """,
 | 
				
			||||||
        backref=orm.backref('worked_shifts', doc="""
 | 
					        backref=orm.backref(
 | 
				
			||||||
 | 
					            'worked_shifts',
 | 
				
			||||||
 | 
					            cascade_backrefs=False,
 | 
				
			||||||
 | 
					            doc="""
 | 
				
			||||||
            Sequence of :class:`rattail.db.model.WorkedShift` instances for the
 | 
					            Sequence of :class:`rattail.db.model.WorkedShift` instances for the
 | 
				
			||||||
            employee.
 | 
					            employee.
 | 
				
			||||||
            """))
 | 
					            """))
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -2,7 +2,7 @@
 | 
				
			||||||
################################################################################
 | 
					################################################################################
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
#  Rattail -- Retail Software Framework
 | 
					#  Rattail -- Retail Software Framework
 | 
				
			||||||
#  Copyright © 2010-2020 Lance Edgar
 | 
					#  Copyright © 2010-2023 Lance Edgar
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
#  This file is part of Rattail.
 | 
					#  This file is part of Rattail.
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
| 
						 | 
					@ -24,9 +24,6 @@
 | 
				
			||||||
Base data model for "shopfoo" pattern
 | 
					Base data model for "shopfoo" pattern
 | 
				
			||||||
"""
 | 
					"""
 | 
				
			||||||
 | 
					
 | 
				
			||||||
from __future__ import unicode_literals, absolute_import
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
import six
 | 
					 | 
				
			||||||
import sqlalchemy as sa
 | 
					import sqlalchemy as sa
 | 
				
			||||||
from sqlalchemy import orm
 | 
					from sqlalchemy import orm
 | 
				
			||||||
from sqlalchemy.ext.declarative import declared_attr
 | 
					from sqlalchemy.ext.declarative import declared_attr
 | 
				
			||||||
| 
						 | 
					@ -68,12 +65,12 @@ class ShopfooProductBase(object):
 | 
				
			||||||
            backref=orm.backref(
 | 
					            backref=orm.backref(
 | 
				
			||||||
                backref_name,
 | 
					                backref_name,
 | 
				
			||||||
                uselist=False,
 | 
					                uselist=False,
 | 
				
			||||||
 | 
					                cascade_backrefs=False,
 | 
				
			||||||
                doc="""
 | 
					                doc="""
 | 
				
			||||||
                Reference to the local/cached {} record for this product.
 | 
					                Reference to the local/cached {} record for this product.
 | 
				
			||||||
                """.format(backref_name)))
 | 
					                """.format(backref_name)))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@six.python_2_unicode_compatible
 | 
					 | 
				
			||||||
class ShopfooProductExportBase(model.ExportMixin):
 | 
					class ShopfooProductExportBase(model.ExportMixin):
 | 
				
			||||||
    """
 | 
					    """
 | 
				
			||||||
    Product export table, specific to the target system.  Each record in this
 | 
					    Product export table, specific to the target system.  Each record in this
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -2,7 +2,7 @@
 | 
				
			||||||
################################################################################
 | 
					################################################################################
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
#  Rattail -- Retail Software Framework
 | 
					#  Rattail -- Retail Software Framework
 | 
				
			||||||
#  Copyright © 2010-2018 Lance Edgar
 | 
					#  Copyright © 2010-2023 Lance Edgar
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
#  This file is part of Rattail.
 | 
					#  This file is part of Rattail.
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
| 
						 | 
					@ -24,18 +24,14 @@
 | 
				
			||||||
Data models for tempmon
 | 
					Data models for tempmon
 | 
				
			||||||
"""
 | 
					"""
 | 
				
			||||||
 | 
					
 | 
				
			||||||
from __future__ import unicode_literals, absolute_import
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
import datetime
 | 
					import datetime
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import six
 | 
					 | 
				
			||||||
import sqlalchemy as sa
 | 
					import sqlalchemy as sa
 | 
				
			||||||
from sqlalchemy import orm
 | 
					from sqlalchemy import orm
 | 
				
			||||||
 | 
					
 | 
				
			||||||
from rattail.db.model import Base, uuid_column
 | 
					from rattail.db.model import Base, uuid_column
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@six.python_2_unicode_compatible
 | 
					 | 
				
			||||||
class TempmonClient(Base):
 | 
					class TempmonClient(Base):
 | 
				
			||||||
    """
 | 
					    """
 | 
				
			||||||
    Represents a tempmon client.
 | 
					    Represents a tempmon client.
 | 
				
			||||||
| 
						 | 
					@ -60,7 +56,6 @@ class TempmonClient(Base):
 | 
				
			||||||
        return [probe for probe in self.probes if probe.enabled]
 | 
					        return [probe for probe in self.probes if probe.enabled]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@six.python_2_unicode_compatible
 | 
					 | 
				
			||||||
class TempmonProbe(Base):
 | 
					class TempmonProbe(Base):
 | 
				
			||||||
    """
 | 
					    """
 | 
				
			||||||
    Represents a probe connected to a tempmon client.
 | 
					    Represents a probe connected to a tempmon client.
 | 
				
			||||||
| 
						 | 
					@ -82,6 +77,7 @@ class TempmonProbe(Base):
 | 
				
			||||||
        """,
 | 
					        """,
 | 
				
			||||||
        backref=orm.backref(
 | 
					        backref=orm.backref(
 | 
				
			||||||
            'probes',
 | 
					            'probes',
 | 
				
			||||||
 | 
					            cascade_backrefs=False,
 | 
				
			||||||
            doc="""
 | 
					            doc="""
 | 
				
			||||||
            List of probes connected to this client.
 | 
					            List of probes connected to this client.
 | 
				
			||||||
            """))
 | 
					            """))
 | 
				
			||||||
| 
						 | 
					@ -107,7 +103,6 @@ class TempmonProbe(Base):
 | 
				
			||||||
        return str(self.description or '')
 | 
					        return str(self.description or '')
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@six.python_2_unicode_compatible
 | 
					 | 
				
			||||||
class TempmonReading(Base):
 | 
					class TempmonReading(Base):
 | 
				
			||||||
    """
 | 
					    """
 | 
				
			||||||
    Represents a single tempurate reading from a tempmon probe.
 | 
					    Represents a single tempurate reading from a tempmon probe.
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -2,7 +2,7 @@
 | 
				
			||||||
################################################################################
 | 
					################################################################################
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
#  Rattail -- Retail Software Framework
 | 
					#  Rattail -- Retail Software Framework
 | 
				
			||||||
#  Copyright © 2010-2022 Lance Edgar
 | 
					#  Copyright © 2010-2023 Lance Edgar
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
#  This file is part of Rattail.
 | 
					#  This file is part of Rattail.
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
| 
						 | 
					@ -24,18 +24,14 @@
 | 
				
			||||||
Data models for scheduled app upgrades
 | 
					Data models for scheduled app upgrades
 | 
				
			||||||
"""
 | 
					"""
 | 
				
			||||||
 | 
					
 | 
				
			||||||
from __future__ import unicode_literals, absolute_import
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
import datetime
 | 
					import datetime
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import six
 | 
					 | 
				
			||||||
import sqlalchemy as sa
 | 
					import sqlalchemy as sa
 | 
				
			||||||
from sqlalchemy import orm
 | 
					from sqlalchemy import orm
 | 
				
			||||||
 | 
					
 | 
				
			||||||
from rattail.db.model import Base, uuid_column, User
 | 
					from rattail.db.model import Base, uuid_column, User
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@six.python_2_unicode_compatible
 | 
					 | 
				
			||||||
class Upgrade(Base):
 | 
					class Upgrade(Base):
 | 
				
			||||||
    """
 | 
					    """
 | 
				
			||||||
    Represents a scheduled app upgrade.
 | 
					    Represents a scheduled app upgrade.
 | 
				
			||||||
| 
						 | 
					@ -125,7 +121,8 @@ class UpgradeRequirement(Base):
 | 
				
			||||||
    upgrade = orm.relationship(
 | 
					    upgrade = orm.relationship(
 | 
				
			||||||
        Upgrade,
 | 
					        Upgrade,
 | 
				
			||||||
        backref=orm.backref(
 | 
					        backref=orm.backref(
 | 
				
			||||||
            'requirements'))
 | 
					            'requirements',
 | 
				
			||||||
 | 
					            cascade_backrefs=False))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    package = sa.Column(sa.String(length=255), nullable=False, doc="""
 | 
					    package = sa.Column(sa.String(length=255), nullable=False, doc="""
 | 
				
			||||||
    Package name as found on PyPI (or at least interpretable by pip).
 | 
					    Package name as found on PyPI (or at least interpretable by pip).
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -181,6 +181,7 @@ class User(Base):
 | 
				
			||||||
        """,
 | 
					        """,
 | 
				
			||||||
        backref=orm.backref(
 | 
					        backref=orm.backref(
 | 
				
			||||||
            'users',
 | 
					            'users',
 | 
				
			||||||
 | 
					            cascade_backrefs=False,
 | 
				
			||||||
            doc="""
 | 
					            doc="""
 | 
				
			||||||
            List of user accounts for the person.  Typically there is
 | 
					            List of user accounts for the person.  Typically there is
 | 
				
			||||||
            only one user account per person, but technically multiple
 | 
					            only one user account per person, but technically multiple
 | 
				
			||||||
| 
						 | 
					@ -347,6 +348,7 @@ class UserEvent(Base):
 | 
				
			||||||
        backref=orm.backref(
 | 
					        backref=orm.backref(
 | 
				
			||||||
            'events',
 | 
					            'events',
 | 
				
			||||||
            cascade='all, delete-orphan',
 | 
					            cascade='all, delete-orphan',
 | 
				
			||||||
 | 
					            cascade_backrefs=False,
 | 
				
			||||||
            doc="""
 | 
					            doc="""
 | 
				
			||||||
            Sequence of events for the user.
 | 
					            Sequence of events for the user.
 | 
				
			||||||
            """))
 | 
					            """))
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -176,7 +176,8 @@ class VendorContact(Base):
 | 
				
			||||||
        Person,
 | 
					        Person,
 | 
				
			||||||
        backref=orm.backref(
 | 
					        backref=orm.backref(
 | 
				
			||||||
            '_vendor_contacts',
 | 
					            '_vendor_contacts',
 | 
				
			||||||
            cascade='all, delete-orphan'))
 | 
					            cascade='all, delete-orphan',
 | 
				
			||||||
 | 
					            cascade_backrefs=False))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def __str__(self):
 | 
					    def __str__(self):
 | 
				
			||||||
        return str(self.person)
 | 
					        return str(self.person)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -2,7 +2,7 @@
 | 
				
			||||||
################################################################################
 | 
					################################################################################
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
#  Rattail -- Retail Software Framework
 | 
					#  Rattail -- Retail Software Framework
 | 
				
			||||||
#  Copyright © 2010-2022 Lance Edgar
 | 
					#  Copyright © 2010-2023 Lance Edgar
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
#  This file is part of Rattail.
 | 
					#  This file is part of Rattail.
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
| 
						 | 
					@ -24,8 +24,6 @@
 | 
				
			||||||
Data Models for Work Orders
 | 
					Data Models for Work Orders
 | 
				
			||||||
"""
 | 
					"""
 | 
				
			||||||
 | 
					
 | 
				
			||||||
from __future__ import unicode_literals, absolute_import
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
import sqlalchemy as sa
 | 
					import sqlalchemy as sa
 | 
				
			||||||
from sqlalchemy import orm
 | 
					from sqlalchemy import orm
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -57,6 +55,7 @@ class WorkOrder(Base):
 | 
				
			||||||
        """,
 | 
					        """,
 | 
				
			||||||
        backref=orm.backref(
 | 
					        backref=orm.backref(
 | 
				
			||||||
            'workorders',
 | 
					            'workorders',
 | 
				
			||||||
 | 
					            cascade_backrefs=False,
 | 
				
			||||||
            doc="""
 | 
					            doc="""
 | 
				
			||||||
            Sequence of all work orders for this customer.
 | 
					            Sequence of all work orders for this customer.
 | 
				
			||||||
            """))
 | 
					            """))
 | 
				
			||||||
| 
						 | 
					@ -131,7 +130,8 @@ class WorkOrderEvent(Base):
 | 
				
			||||||
        backref=orm.backref(
 | 
					        backref=orm.backref(
 | 
				
			||||||
            'events',
 | 
					            'events',
 | 
				
			||||||
            order_by='WorkOrderEvent.occurred',
 | 
					            order_by='WorkOrderEvent.occurred',
 | 
				
			||||||
            cascade='all, delete-orphan'))
 | 
					            cascade='all, delete-orphan',
 | 
				
			||||||
 | 
					            cascade_backrefs=False))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    type_code = sa.Column(sa.Integer, nullable=False, doc="""
 | 
					    type_code = sa.Column(sa.Integer, nullable=False, doc="""
 | 
				
			||||||
    Code specifying the type of event this is.
 | 
					    Code specifying the type of event this is.
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue