mirror of https://github.com/snachodog/mybuddy.git
Update naps card to pass timedelta directly.
This commit is contained in:
parent
31f747e908
commit
5a57ac7a48
|
@ -14,5 +14,5 @@
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
{% if total.duration__sum %}{{ total.duration__sum|duration_string }}{% endif %}
|
{% if total %}{{ total|duration_string }}{% endif %}
|
||||||
{% endblock %}
|
{% endblock %}
|
|
@ -148,7 +148,7 @@ def card_sleep_naps_day(child, date=None):
|
||||||
instances = models.Sleep.naps.filter(child=child, start__date=date)
|
instances = models.Sleep.naps.filter(child=child, start__date=date)
|
||||||
return {
|
return {
|
||||||
'type': 'sleep',
|
'type': 'sleep',
|
||||||
'total': instances.aggregate(Sum('duration')),
|
'total': instances.aggregate(Sum('duration'))['duration__sum'],
|
||||||
'count': len(instances)}
|
'count': len(instances)}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue