0๐
โ
Looks like this is a known bug in Django 1.6, and need to upgrade to 1.7+ to fix
For now, I will just do the math in python.
๐คC.B.
0๐
I think this is what you need, please give a feedback after test the line below:
MyModel.objects.filter(...).values('user__id').distinct().annotate(sum=Sum('value')).aggregate(Avg('sum'))
๐คGocht
- [Django]-Populate CheckboxSelectMultiple with existing data from django model form
- [Django]-How to have nested url namespaces with a dynamic first part in Django
- [Django]-Using Python 3.7 on Pycharm gives me: "Error: Django is not importable in this environment"
- [Django]-Collectstatic command excluding nested directories and files
- [Django]-Relative font URLs in CSS cause 403s on S3
Source:stackexchange.com