I'm simply trying to group entries in my Data.active_objects that occur in the same month and year. I would like if entries sharing the same month and year would be annotated with the number of occurrences in Data.active_objects
Data.active_objects has a few entries with the same month values in 'ts_create'
What I've tried so far is
test = Data.active_objects.annotate(ts_create__count=Count(TruncMonth('ts_create), distinct=True)
However, this does not produce results that I would expect as every entry in Data.active_objects has an annotated value 'ts_create__count' of 1 even when the entries occur in the same month