if your aren't counting or averaging then why are you grouping?
D
On 2 March 2016 at 17:06, <marcin.j.nowak@gmail.com> wrote:
Hello,--I would like to query database with Django ORM and add GROUP BY clause without including unnecessary counting, avg, etc.I can force/hack queryset by settting qs.query.group_by=['my_column'], but this is unclean and risky.Is possible something like:MyModel.objects.filter(...).group_by('my_column')?Kind Regards,Marcin
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/64f4b422-7704-413d-a9c5-837c53eaefc9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Wildman and Herring Limited, Registered Office: 52 Great Eastern Street, London, EC2A 3EP, Company no: 05766374
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAPZHCY7tKM%2BBFPGf0o%3DXwJBOAhiyt8Avu0Xbe%2BqpfeiFQoRafA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
No comments:
Post a Comment