3

I'm using django 1.7 (for a short while longer(!)) and I'm trying to do the following:

<non-uniq qs>.distinct().annotate(agg1=Aggregate1, agg2=Aggregate2...)

And the aggregate is ignoring the distinct. I'd rather it wasn't (as it's wrecking my charts!); is there a way round this?

David Boshton
  • 2,555
  • 5
  • 30
  • 51
  • 1
    There isn't any guarantee that the distinct will happen before the annotate which explains why its happening, im not sure of a solution for you though other than non query set aggregation – Sayse Feb 04 '16 at 14:27
  • 2
    Possible duplicate of [How to add an annotation on distinct items?](http://stackoverflow.com/questions/4048014/how-to-add-an-annotation-on-distinct-items) – Sayse Feb 04 '16 at 14:29

0 Answers0