I'm trying to get to a result that tells me something like 10.5 hours worked on a project.
here's what I'm doing in my view:
time = Time.objects.filter(my_company=my_company, project=project)
raw_hours = time.aggregate(Sum('hours'))
raw_minutes = time.aggregate(Sum('minutes'))
adj_minutes = raw_minutes.raw_minutes__sum / 100
hours = adj_minutes + raw_hours.raw_hours__sum
return {'hours': hours}
When I add {{ view.hours }}
to my template, I'm not seeing anything in the return. I'm expecting view.hours == 10.5
or something like that depending on the math.
So I have two questions. Am I thinking about this correctly and is there a more efficient way to do this?
Thanks for you help.