From 0aeca336b7089ae3d256c1b2a779b6beebbe7088 Mon Sep 17 00:00:00 2001 From: richard-dds Date: Tue, 25 Sep 2018 11:18:22 -0400 Subject: [PATCH] Add displayname to Project and Environment --- atst/models/environment.py | 4 ++++ atst/models/project.py | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/atst/models/environment.py b/atst/models/environment.py index 2d56f9da..61b5c910 100644 --- a/atst/models/environment.py +++ b/atst/models/environment.py @@ -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 diff --git a/atst/models/project.py b/atst/models/project.py index c276b240..cd9ab019 100644 --- a/atst/models/project.py +++ b/atst/models/project.py @@ -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