Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

Average of total in django querysets

>>> from django.db.models import Avg
>>> Book.objects.all().aggregate(Avg('price'))
{'price__avg': 34.35}
Source by docs.djangoproject.com #
 
PREVIOUS NEXT
Tagged: #Average #total #django #querysets
ADD COMMENT
Topic
Name
8+1 =