[Answered ]-What's this after aggregation in django?

2👍

Here if you look in examples you will see that aggregate returns dictionary so last part is just dict lookup

aggregation = Project.objects.filter(project = project).aggregate(Sum('kw'))
result = aggregation['kw__sum']

From the docs

Returns a dictionary of aggregate values (averages, sums, etc.) calculated over the QuerySet. Each argument to aggregate() specifies a value that will be included in the dictionary that is returned.

Leave a comment