* status: new => closed
* resolution: => invalid
Comment:
I think you need to `count=Count("month")`, rather than the PK.
([https://docs.djangoproject.com/en/3.1/topics/db/aggregation/ See the
aggregation topic guide.])
Please don't use the issue tracker as a secondary support channel. See
TicketClosingReasons/UseSupportChannels
--
Ticket URL: <https://code.djangoproject.com/ticket/32059#comment:4>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
Comment (by Carlton Gibson):
My comment is too quick.
[https://docs.djangoproject.com/en/3.1/topics/db/aggregation/#values The
use of `values` means the `pk` should work too.].
However, it looks like you've hit the
[https://docs.djangoproject.com/en/3.1/topics/db/aggregation/#interaction-
with-default-ordering-or-order-by default `order_by` issue] below the
linked section there. (Note the `ORDER BY `auth_user`.`date_joined` DESC`
in the SQL.) If you append `.order_by()` clearing the ordering it should
work (as it is testing.)
Hopefully that helps.
--
Ticket URL: <https://code.djangoproject.com/ticket/32059#comment:5>