Open henriquensco opened 4 years ago
Usar aggragate
Exemplo from django.db.models import Avg, Count, Min, Sum Books.objects.all().aggregate(Sum('price'))
from django.db.models import Avg, Count, Min, Sum Books.objects.all().aggregate(Sum('price'))
https://docs.djangoproject.com/en/3.0/topics/db/aggregation/
Usar aggragate
Exemplo
from django.db.models import Avg, Count, Min, Sum Books.objects.all().aggregate(Sum('price'))
https://docs.djangoproject.com/en/3.0/topics/db/aggregation/