I have a database Result.objects.all() of around 15 objects. Result has a field called score which ranges from 1-5. So if I preform q = Result.objecets.get(id=1), q.score is 2.
What’s a method of finding the average of all scores for all 15 objects?
I have a database Result.objects.all() of around 15 objects. Result has a field called
Share
You can use django aggregation functions to do this;