Private
Public Access
1
0

different pie chart for types

This commit is contained in:
Sander Roosendaal
2020-05-09 15:50:52 +02:00
parent 95739145a9
commit 24750be04e
4 changed files with 52 additions and 62 deletions

View File

@@ -260,16 +260,17 @@ from django_mailbox.models import Message,Mailbox,MessageAttachment
from rules.contrib.views import permission_required, objectgetter
def get_totals(workouts):
totalminutes = 0
totalseconds = 0
totalmeters = 0
for w in workouts:
totalmeters += w.distance
totalminutes += w.duration.hour*60+w.duration.minute
totalseconds += 60*(w.duration.hour*60+w.duration.minute)+w.duration.second
totalhour, totalminutes = divmod(totalminutes,60)
hours, remainder = divmod(totalseconds,3600)
minutes, seconds = divmod(remainder,60)
return totalmeters,totalhour, totalminutes
return totalmeters,hours, minutes, seconds
# creating shareable views
def allow_shares(view_func):