Django + PostgreSQL: Fill missing dates in a range
问题 I have a table with one of the columns as date . It can have multiple entries for each date. date ..... ----------- ----- 2015-07-20 .. 2015-07-20 .. 2015-07-23 .. 2015-07-24 .. I would like to get data in the following form using Django ORM with PostgreSQL as database backend: date count(date) ----------- ----------- 2015-07-20 2 2015-07-21 0 (missing after aggregation) 2015-07-22 0 (missing after aggregation) 2015-07-23 1 2015-07-24 1 Corresponding PostgreSQL Query: WITH RECURSIVE date_view