I'm working on a Django timesheet application and am having trouble figuring out how to include aggregate sums that equal zero. If I do something like:
entries = TimeEntry.objects.all().values("user__username").annotate(Sum("hours"))
I get all users that have time entries and their sums.
[{'username': u'bob' 'hours__sum':49}, {'username': u'jane' 'hours__sum':10}]
When I filter that by a given day:
filtered_entries = entries.filter(date="2010-05-17")
Anyone who didn't enter time for that day is excluded. Is there a way to include those users who's sums are 0?
Thanks