Skip to content

Commit

Permalink
Add properties for getting project and workspace names
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreyMarkinPPC committed Jan 31, 2024
1 parent 4baa187 commit 6c8d77d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions terka/domain/entities/composite.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@ def __init__(self,
self.status = status
self.is_completed = False

@property
def project_name(self) -> str:
if project := self.project_:
return project.name
return ""

@property
def backlog_tasks(self) -> list[Task]:
tasks = []
Expand Down
6 changes: 6 additions & 0 deletions terka/domain/entities/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@ def __init__(self,
self.status = status
self.workspace = workspace

@property
def workspace_name(self) -> str:
if workspace := self.workspace_:
return workspace.name
return ""

def _validate_status(self, status):
if status not in [
s.name for s in ProjectStatus if s.name != "DELETED"
Expand Down

0 comments on commit 6c8d77d

Please sign in to comment.