Tsallaka zuwa abun ciki
Justice Tech School

Aggregation

aggregate and annotate compute values.

Example
from django.db.models import Count, Avg
Post.objects.aggregate(avg=Avg("views"))
Author.objects.annotate(n=Count("post"))

Exercise

Average.

("views")

Quiz Test

What does annotate add?

These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.