different pie chart for types
This commit is contained in:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user