Rename custdata model to CustomerClassic

This commit is contained in:
Lance Edgar 2023-06-12 17:28:55 -05:00
parent 852a989bd5
commit 4952d2fa3d
2 changed files with 17 additions and 9 deletions

View file

@ -209,7 +209,7 @@ class Product(Base):
last_sold = sa.Column(sa.DateTime(), nullable=True)
class CustData(Base):
class CustomerClassic(Base):
"""
Represents a customer of the organization.
@ -275,3 +275,7 @@ class CustData(Base):
def __str__(self):
return "{} {}".format(self.first_name or '', self.last_name or '').strip()
# TODO: deprecate / remove this
CustData = CustomerClassic

View file

@ -1153,7 +1153,7 @@ class Customer(Base):
return "{} {}".format(self.first_name or '', self.last_name or '').strip()
class CustData(Base):
class CustomerClassic(Base):
"""
Represents a customer of the organization.
@ -1219,7 +1219,7 @@ class CustData(Base):
member_info = orm.relationship(
'MemberInfo',
primaryjoin='MemberInfo.card_number == CustData.card_number',
primaryjoin='MemberInfo.card_number == CustomerClassic.card_number',
foreign_keys=[card_number],
uselist=False,
back_populates='customers',
@ -1231,6 +1231,10 @@ class CustData(Base):
return "{} {}".format(self.first_name or '', self.last_name or '').strip()
# TODO: deprecate / remove this
CustData = CustomerClassic
class MemberInfo(Base):
"""
Contact info regarding a member of the organization.
@ -1264,14 +1268,14 @@ class MemberInfo(Base):
ads_ok = sa.Column('ads_OK', sa.Boolean(), nullable=True, default=True)
customers = orm.relationship(
CustData,
primaryjoin=CustData.card_number == card_number,
order_by=CustData.person_number,
foreign_keys=[CustData.card_number],
CustomerClassic,
primaryjoin=CustomerClassic.card_number == card_number,
order_by=CustomerClassic.person_number,
foreign_keys=[CustomerClassic.card_number],
back_populates='member_info',
remote_side=CustData.card_number,
remote_side=CustomerClassic.card_number,
doc="""
List of :class:`CustData` instances which are associated with this member info.
List of :class:`CustomerClassic` instances which are associated with this member info.
""")
dates = orm.relationship(