Re: annotate sum many record

2019-06-03 Thread Aditya Singh
Hello mate, Simple get the value from the objects and store in separate variables. Then you may do any and as many calculations you want and return the desired value :) Kind Regards, Aditya On Mon, Jun 3, 2019, 12:18 PM carlos wrote: > Hi, i used django 1.11 and try used annotate > > i have

annotate sum many record

2019-06-03 Thread carlos
Hi, i used django 1.11 and try used annotate i have model with 3 decimal fields i would like sum 2 and multiply for other field but with aritmetic calculation i have used this query (1) total = Model.objects.annotate(all=Sum(F('fieldA') + F('fieldB') * F('fieldC'))) but this return queryset with