Partition and serialize task orders need on funding page

This commit is contained in:
Patrick Smith
2019-01-15 17:29:13 -05:00
parent 8cc46c9e05
commit a6a53525f8
2 changed files with 32 additions and 2 deletions

View File

@@ -88,12 +88,21 @@ class TaskOrder(Base, mixins.TimestampsMixin):
else:
return Status.PENDING
@property
def display_status(self):
return self.status.value
@property
def budget(self):
return sum(
filter(None, [self.clin_01, self.clin_02, self.clin_03, self.clin_04])
)
@property
def balance(self):
# TODO: somehow calculate the remaining balance. For now, assume $0 spent
return self.budget
@property
def portfolio_name(self):
return self.portfolio.name