from django.db.models import Avg teams = Analysts.objects.values('class').annotate(avgcap=Avg('gpa')) # Assuming Analysts model has class and gpa field.. # This will group by class field and give the avg of gpa field values