Храните переменную списка с помощью функции Avg в агрегате Django
Как сохранить и передать несколько функций Avg в агрегате код ниже выдает ошибку типа
views.py
riasec_avg =[Avg('realistic'),Avg('investigative'),Avg('artistic'),Avg('social'),Avg('enterprising'),Avg('conventional')]
context['riasec_male'] = Riasec_result.objects.filter(user__profile__gender='M').aggregate(riasec_avg)
context['riasec_female'] = Riasec_result.objects.filter(user__profile__gender='F').aggregate(riasec_avg)
Использовать args
riasec_avg =(Avg('realistic'),Avg('investigative'),Avg('artistic'),Avg('social'),Avg('enterprising'),Avg('conventional'))
context['riasec_male'] = Riasec_result.objects.filter(user__profile__gender='M').aggregate(*riasec_avg)
context['riasec_female'] = Riasec_result.objects.filter(user__profile__gender='F').aggregate(*riasec_avg)