I want to get the count of records over 14 days
I'm currently doing:
class Invitation(models.Model):
...
start_date = models.DateTimeField(default=timezone.now)
all_invitations = Invitation.objects.all()
days14 = all_invitations.filter(start_date__range=[today - timedelta(days=7), today + timedelta(days=8)]).annotate(day=TruncDay('start_date')).values('day').annotate(count=Count('id')).values('day', 'count').order_by('day')
However, this does not give me the days for which there are 0 invitations. How do I achieve that?