Add displayname to Project and Environment
This commit is contained in:
parent
ac3d070178
commit
0aeca336b7
@ -23,5 +23,9 @@ class Environment(Base, mixins.TimestampsMixin, mixins.AuditableMixin):
|
|||||||
def num_users(self):
|
def num_users(self):
|
||||||
return len(self.users)
|
return len(self.users)
|
||||||
|
|
||||||
|
@property
|
||||||
|
def displayname(self):
|
||||||
|
return self.name
|
||||||
|
|
||||||
def auditable_workspace_id(self):
|
def auditable_workspace_id(self):
|
||||||
return self.project.workspace_id
|
return self.project.workspace_id
|
||||||
|
@ -16,3 +16,8 @@ class Project(Base, mixins.TimestampsMixin, mixins.AuditableMixin):
|
|||||||
workspace_id = Column(ForeignKey("workspaces.id"), nullable=False)
|
workspace_id = Column(ForeignKey("workspaces.id"), nullable=False)
|
||||||
workspace = relationship("Workspace")
|
workspace = relationship("Workspace")
|
||||||
environments = relationship("Environment", back_populates="project")
|
environments = relationship("Environment", back_populates="project")
|
||||||
|
|
||||||
|
|
||||||
|
@property
|
||||||
|
def displayname(self):
|
||||||
|
return self.name
|
||||||
|
Loading…
x
Reference in New Issue
Block a user