Rename "old" Customer model, to CustData
need to make room for "new" Customer model
This commit is contained in:
parent
5509089741
commit
92f522cf65
|
@ -390,7 +390,7 @@ class MemberType(Base):
|
||||||
return self.description or ""
|
return self.description or ""
|
||||||
|
|
||||||
|
|
||||||
class Customer(Base):
|
class CustData(Base):
|
||||||
"""
|
"""
|
||||||
Represents a customer of the organization.
|
Represents a customer of the organization.
|
||||||
"""
|
"""
|
||||||
|
@ -451,7 +451,7 @@ class Customer(Base):
|
||||||
|
|
||||||
member_info = orm.relationship(
|
member_info = orm.relationship(
|
||||||
'MemberInfo',
|
'MemberInfo',
|
||||||
primaryjoin='MemberInfo.card_number == Customer.card_number',
|
primaryjoin='MemberInfo.card_number == CustData.card_number',
|
||||||
foreign_keys=[card_number],
|
foreign_keys=[card_number],
|
||||||
uselist=False,
|
uselist=False,
|
||||||
back_populates='customers',
|
back_populates='customers',
|
||||||
|
@ -463,6 +463,10 @@ class Customer(Base):
|
||||||
return "{} {}".format(self.first_name or '', self.last_name or '').strip()
|
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):
|
class MemberInfo(Base):
|
||||||
"""
|
"""
|
||||||
Contact info regarding a member of the organization.
|
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)
|
ads_ok = sa.Column('ads_OK', sa.Boolean(), nullable=True, default=True)
|
||||||
|
|
||||||
customers = orm.relationship(
|
customers = orm.relationship(
|
||||||
Customer,
|
CustData,
|
||||||
primaryjoin=Customer.card_number == card_number,
|
primaryjoin=CustData.card_number == card_number,
|
||||||
foreign_keys=[Customer.card_number],
|
foreign_keys=[CustData.card_number],
|
||||||
back_populates='member_info',
|
back_populates='member_info',
|
||||||
remote_side=Customer.card_number,
|
remote_side=CustData.card_number,
|
||||||
doc="""
|
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(
|
dates = orm.relationship(
|
||||||
|
|
Loading…
Reference in a new issue