Remove unnecessary "duration_td" Tummy Time method.

This commit is contained in:
Christopher Charbonneau Wells 2017-10-25 09:45:53 -04:00
parent e3b0fc2468
commit 05e9927d74
2 changed files with 1 additions and 5 deletions

View File

@ -202,9 +202,6 @@ class TummyTime(models.Model):
def __str__(self):
return 'Tummy Time'
def duration_td(self):
return self.end - self.start
def save(self, *args, **kwargs):
if self.start and self.end:
self.duration = self.end - self.start

View File

@ -155,6 +155,5 @@ def card_tummytime_day(child, date=None):
'count': instances.count()
}
for instance in instances:
stats['total'] += timezone.timedelta(
seconds=instance.duration_td().seconds)
stats['total'] += timezone.timedelta(seconds=instance.duration.seconds)
return {'stats': stats, 'instances': instances, 'last': instances.first()}