we need both last_campaign and last_campaign_status after all; template can't handle all the logic for status in event of last_campaign = None

pull/1/head
thatandromeda 2011-11-06 14:31:08 -05:00
parent 773789dc99
commit 6e81dce947
1 changed files with 8 additions and 0 deletions

View File

@ -133,6 +133,14 @@ class Work(models.Model):
except:
last = None
return last
def last_campaign_status(self):
campaign = self.last_campaign
if campaign:
status = campaign.status
else:
status = "No campaign yet"
return status
def percent_unglued(self):
status = 0