def duration(self): if self.ended == None: ts = self.started- self.started days = ts.days + 1 return "%d days" % days else: print timesince(self.started, self.ended) days = ts.days + 1 return "%d days" % days
def __unicode__(self): return ' '.join([self.current_status,'('+timesince(self.timestamp)+' ago)'])
def timesince(self, now=None): from django.utils import timesince return timesince(self.created, now)
def __unicode__(self): return " ".join([self.current_status, "(" + timesince(self.timestamp) + " ago)"])
def ago(self, obj): return timesince(obj.created_date)
def get_age(self): return timesince(self.date_joined)