From 68ab8ff55dfe55467dcd8195865c348a909a3c53 Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Mon, 13 Jul 2020 11:03:32 -0500 Subject: [PATCH] Add `CustomerAccount.customer_type` reference, to `MemberType` not 100% sure about the best naming here, hopefully this is good --- corepos/db/office_op/model.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/corepos/db/office_op/model.py b/corepos/db/office_op/model.py index f525144..400c4a6 100644 --- a/corepos/db/office_op/model.py +++ b/corepos/db/office_op/model.py @@ -801,6 +801,13 @@ class CustomerAccount(Base): customer_type_id = sa.Column('customerTypeID', sa.Integer(), nullable=True, default=1) + customer_type = orm.relationship( + MemberType, + primaryjoin=MemberType.id == customer_type_id, + foreign_keys=[customer_type_id], + doc=""" + Reference to the :class:`MemberType` with which this account is associated. + """) charge_balance = sa.Column('chargeBalance', sa.Numeric(precision=10, scale=2), nullable=True, default=0)