minor: relationship key definitions to strings
Using the objects directly was causing type checking issues. Strings are equivalent so no functional change.
This commit is contained in:
parent
3e4f68dd9b
commit
0a867c9c90
2 changed files with 11 additions and 5 deletions
|
|
@ -42,7 +42,7 @@ class Permission(Base):
|
|||
),
|
||||
)
|
||||
|
||||
service_rel = relationship("Service", foreign_keys=[service_id])
|
||||
service_rel = relationship("Service", foreign_keys="Permission.service_id")
|
||||
|
||||
@property
|
||||
def service_name(self):
|
||||
|
|
|
|||
|
|
@ -39,15 +39,21 @@ class Organisation(Base):
|
|||
)
|
||||
|
||||
group_rel = relationship("Group", back_populates="org_rel")
|
||||
root_user_rel = relationship("User", foreign_keys=[root_user_id])
|
||||
root_user_rel = relationship("User", foreign_keys="Organisation.root_user_id")
|
||||
|
||||
@property
|
||||
def root_user_email(self):
|
||||
return self.root_user_rel.email if self.root_user_rel else None
|
||||
|
||||
billing_contact_rel = relationship("Contact", foreign_keys=[billing_contact_id])
|
||||
security_contact_rel = relationship("Contact", foreign_keys=[security_contact_id])
|
||||
owner_contact_rel = relationship("Contact", foreign_keys=[owner_contact_id])
|
||||
billing_contact_rel = relationship(
|
||||
"Contact", foreign_keys="Organisation.billing_contact_id"
|
||||
)
|
||||
security_contact_rel = relationship(
|
||||
"Contact", foreign_keys="Organisation.security_contact_id"
|
||||
)
|
||||
owner_contact_rel = relationship(
|
||||
"Contact", foreign_keys="Organisation.owner_contact_id"
|
||||
)
|
||||
|
||||
|
||||
class OrgUsers(Base):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue