Suppose I have a object model A, and it has a field called created, which is a datetime type field.
If I use annotate to count how many A are created each day, I can use
A.objects.annotate(date=Trunc('created', 'day', output_field=DateField()) ).values('date').order_by('date').annotate(count=Count('id'))
After that, I can get the result, which looks like
[{date: '2018-07-22', count:1 }, {date: '2018-07-23', count:1 }, {date: '2018-07-25', count:1 }]
However, notice that I miss a 2018-07-24 because it didn't create any A in that day. Is there any way to let result to have {date: '2018-07-24', count:0 }
inside that queryset?