forked from sr2/cloud-api
feat: condensed org get endpoints
The process also added improved ORM relationships for multiple models.
This commit is contained in:
parent
a80767d870
commit
707482adc2
3 changed files with 8 additions and 12 deletions
|
|
@ -33,6 +33,11 @@ class Organisation(Base):
|
|||
)
|
||||
|
||||
group_rel = relationship("Group", back_populates="org_rel")
|
||||
root_user_rel = relationship("User", foreign_keys=[root_user_id])
|
||||
|
||||
@property
|
||||
def root_user_email(self):
|
||||
return self.root_user_rel.email if self.root_user_rel else None
|
||||
|
||||
|
||||
class OrgUsers(Base):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue