Re: Annotate giving back individual queries rather than results

2018-12-02 Thread Simon Charette
Hey there, I just wanted to clarify that the behavior of including the Meta.ordering fields in aggregation grouping been around for a while and Django 2.2 deprecates it to deal with the exact type of confusion you experienced here. Best, Simon Le dimanche 2 décembre 2018 08:51:17 UTC-5, Coder Du

Re: Annotate giving back individual queries rather than results

2018-12-02 Thread Coder Dude
Solved It. It seems as of django 2.1, we need to add another parameter order_by *Submission*.*objects*.values('user').annotate(Count('id')).order_by('user') *documentation * *Thanks*

Annotate giving back individual queries rather than results

2018-12-02 Thread Coder Dude
Here are my models: from django.contrib.auth.models import User as DefaultUser class Submission(models.Model): user = models.ForeignKey(to=DefaultUser, on_delete=models.CASCADE ) total_score = models.DecimalField() The query that I am trying is : *Submission*.*objects*.values('user').annotate(C