mirror of https://github.com/snachodog/mybuddy.git
Remove unnecessary "duration_td" Tummy Time method.
This commit is contained in:
parent
e3b0fc2468
commit
05e9927d74
|
@ -202,9 +202,6 @@ class TummyTime(models.Model):
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return 'Tummy Time'
|
return 'Tummy Time'
|
||||||
|
|
||||||
def duration_td(self):
|
|
||||||
return self.end - self.start
|
|
||||||
|
|
||||||
def save(self, *args, **kwargs):
|
def save(self, *args, **kwargs):
|
||||||
if self.start and self.end:
|
if self.start and self.end:
|
||||||
self.duration = self.end - self.start
|
self.duration = self.end - self.start
|
||||||
|
|
|
@ -155,6 +155,5 @@ def card_tummytime_day(child, date=None):
|
||||||
'count': instances.count()
|
'count': instances.count()
|
||||||
}
|
}
|
||||||
for instance in instances:
|
for instance in instances:
|
||||||
stats['total'] += timezone.timedelta(
|
stats['total'] += timezone.timedelta(seconds=instance.duration.seconds)
|
||||||
seconds=instance.duration_td().seconds)
|
|
||||||
return {'stats': stats, 'instances': instances, 'last': instances.first()}
|
return {'stats': stats, 'instances': instances, 'last': instances.first()}
|
||||||
|
|
Loading…
Reference in New Issue