title: Django count unique dates in queryset
body: <p>I have a queryset that return objects like this:</p>
  
  <pre><code>[
    {created_at: "2018-03-01"}, 
    {created_at: "2018-03-01"}, 
    {created_at: "2018-03-02"}
  ]
  </code></pre>
  
  <p>I want to select the count of unique days from my queryset. In the above example the expected answer would be <code>2</code>.</p>
  
  <p>My current query look like this, where <code>created_at</code> is a <code>DateTimeField</code>:</p>
  
  <pre class="lang-py prettyprint-override"><code>from django.db.models import Count
  from django.db.models.functions import TruncDate
  
  days = queryset.annotate(date=TruncDate('created_at')) \
      .values('date') \
      .annotate(dates=Count('date'))
  </code></pre>
  
  <p>Unfortunately that returns <code>3</code>, not the expected <code>2</code>.</p>