Thursday, September 24, 2015

Not working query_set.query.group_by = [..] in v1.8

I am upgrade from Django v 1.6 to v1.8. I use this code:

query_set = Rubrica.objects.filter(...).annotate(count=Count('..')).order_by('user', '-pub_date') query_set.query.group_by = ['user_id']

On Django version 1.6 this is works fine, but on version 1.8 results is not grouped by user_id field.

How can I solve this problem?

--
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 http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/60b8cdeb-7e16-4920-a1d1-5b2750864943%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment