caktus/django-timepiece — comment on commit c7926a98b2edd32588823f14e14ccc4c8f2b56e9
File: timepiece/utils.py line 440
By copelco:

I think this can be done a lot easier:

Entry.objects.filter(status='approved', end_time__lt=date, project__id=97).values('activity__activity_bundle').annotate(Sum('hours')).order_by('activity__activity_bundle__order', 'activity__activity_bundle__name')