Add displayname to Project and Environment

This commit is contained in:
richard-dds 2018-09-25 11:18:22 -04:00
parent ac3d070178
commit 0aeca336b7
2 changed files with 9 additions and 0 deletions

View File

@ -23,5 +23,9 @@ class Environment(Base, mixins.TimestampsMixin, mixins.AuditableMixin):
def num_users(self):
return len(self.users)
@property
def displayname(self):
return self.name
def auditable_workspace_id(self):
return self.project.workspace_id

View File

@ -16,3 +16,8 @@ class Project(Base, mixins.TimestampsMixin, mixins.AuditableMixin):
workspace_id = Column(ForeignKey("workspaces.id"), nullable=False)
workspace = relationship("Workspace")
environments = relationship("Environment", back_populates="project")
@property
def displayname(self):
return self.name