This is a know limitation. Please see "Combining multiple aggregations"[1] in the documentation.
Cheers, Simon [1] https://docs.djangoproject.com/en/1.9/topics/db/aggregation/#combining-multiple-aggregations Le vendredi 13 mai 2016 14:56:05 UTC-4, da...@joustco.com a écrit : > > I'm using an aggregate query to gather some information and I'm getting > unexpected results. > > >>> > show_assets.aggregate(media_size=Sum('assetmedia__size')){'media_size': > 652475}>>> show_assets.aggregate(assets_size=Sum('size'), > media_size=Sum('assetmedia__size'),thumb_size=Sum('assetthumb__size')){'assets_size': > > 17488245, 'media_size': 47630675, 'thumb_size': 582827} > Notice the difference in the "media_size" result when doing multiple > aggregates. Is this the intended result or a bug? > -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at https://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/4688db12-c796-4124-8702-2b028139e48d%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.