I need to get an aggregated value from two columns. Therefore, first several of them together, and then get their sum() . The code below naturally does not work, this is just for clarification.
Is it possible or should I use raw SQL?
SomeModel.objects .filter(**something) .aggregate(Sum('one_column' * 'another_col'))
django django-orm django-aggregation
yedpodtrzitko
source share