1👍
You can do
from django.db.models import Avg
candidate = get_object_or_404(Candidate, pk=pk)
average = Evaluation.objects.filter(candidate= candidate).aggregate(Avg('score'))['score__avg']
Source:stackexchange.com
1👍
You can do
from django.db.models import Avg
candidate = get_object_or_404(Candidate, pk=pk)
average = Evaluation.objects.filter(candidate= candidate).aggregate(Avg('score'))['score__avg']