Adding very short summary on list_workouts
This commit is contained in:
@@ -259,6 +259,18 @@ from django_mailbox.models import Message,Mailbox,MessageAttachment
|
||||
|
||||
from rules.contrib.views import permission_required, objectgetter
|
||||
|
||||
def get_totals(workouts):
|
||||
totalminutes = 0
|
||||
totalmeters = 0
|
||||
|
||||
for w in workouts:
|
||||
totalmeters += w.distance
|
||||
totalminutes += w.duration.hour*60+w.duration.minute
|
||||
|
||||
totalhour, totalminutes = divmod(totalminutes,60)
|
||||
|
||||
return totalmeters,totalhour, totalminutes
|
||||
|
||||
# creating shareable views
|
||||
def allow_shares(view_func):
|
||||
def sharify(request, *args, **kwargs):
|
||||
|
||||
Reference in New Issue
Block a user