Changeset - 92f522cf6561
[Not reviewed]
0 1 0
Lance Edgar - 5 years ago 2020-03-16 16:54:40
lance@edbob.org
Rename "old" Customer model, to CustData

need to make room for "new" Customer model
1 file changed with 11 insertions and 7 deletions:
0 comments (0 inline, 0 general) First comment
corepos/db/office_op/model.py
Show inline comments
 
@@ -390,7 +390,7 @@ class MemberType(Base):
 
        return self.description or ""
 

	
 

	
 
class Customer(Base):
 
class CustData(Base):
 
    """
 
    Represents a customer of the organization.
 
    """
 
@@ -451,7 +451,7 @@ class Customer(Base):
 

	
 
    member_info = orm.relationship(
 
        'MemberInfo',
 
        primaryjoin='MemberInfo.card_number == Customer.card_number',
 
        primaryjoin='MemberInfo.card_number == CustData.card_number',
 
        foreign_keys=[card_number],
 
        uselist=False,
 
        back_populates='customers',
 
@@ -463,6 +463,10 @@ class Customer(Base):
 
        return "{} {}".format(self.first_name or '', self.last_name or '').strip()
 

	
 

	
 
# TODO: deprecate / remove this (so we can repurpose, for 'Customers' table)
 
Customer = CustData
 

	
 

	
 
class MemberInfo(Base):
 
    """
 
    Contact info regarding a member of the organization.
 
@@ -496,13 +500,13 @@ class MemberInfo(Base):
 
    ads_ok = sa.Column('ads_OK', sa.Boolean(), nullable=True, default=True)
 

	
 
    customers = orm.relationship(
 
        Customer,
 
        primaryjoin=Customer.card_number == card_number,
 
        foreign_keys=[Customer.card_number],
 
        CustData,
 
        primaryjoin=CustData.card_number == card_number,
 
        foreign_keys=[CustData.card_number],
 
        back_populates='member_info',
 
        remote_side=Customer.card_number,
 
        remote_side=CustData.card_number,
 
        doc="""
 
        List of :class:`Customer` instances which are associated with this member info.
 
        List of :class:`CustData` instances which are associated with this member info.
 
        """)
 

	
 
    dates = orm.relationship(
0 comments (0 inline, 0 general) First comment
You need to be logged in to comment. Login now