Answer the question
In order to leave comments, you need to log in
How to annotate on multiple field values in Django ORM?
We have the simplest model of the form:
Date = models.DateField()
Parameter = models.TextField()
Amount = models.BigIntegerField()
response = models.MyModel.objects.filter(Date__gte=foodate).filter(Date__lte=bardate).values('Date').annotate(sum=Sum('Amount')).order_by()
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question