Answers for "Average of total in django querysets"

0

Average of total in django querysets

>>> from django.db.models import Avg
>>> Book.objects.all().aggregate(Avg('price'))
{'price__avg': 34.35}
Posted by: Guest on February-16-2022

Python Answers by Framework

Browse Popular Code Answers by Language