I was not quite sure how to word the question.
I am trying to make a method in django that queries up objects based on the date they were created at. I plan to use this data to generate a graph.
So far, I am using this:
query.extra(select={"day": "DATE(created_at)"}).values('day').annotate(models.Count("id"))
That works perfectly given that there is at least 1 per day. Without that 1 in each day, it skips the day in my graph.
I would like to avoid looping day by day if possible. This method goes over quite a few days.
Is there an easy way to modify this to include when there are 0 objects in a given day? What would be the best way to go about this?