If we chain a call to filter() after a call to distinct(), the filter is applied to the query before the distinct. How do I filter the results of a query *after* applying distinct?
Example.objects.order_by('a','b').distinct('a').filter(b='something) The where clause in the SQL resulting from filter() means the filter is applied to the query before the distinct. I want to filter the queryset resulting from the distinct. This is probably pretty easy, but I just can't quite figure it out and I can't find anything on it. Another way to ask the question is how do I return a distinct QuerySet and then filter it? -- 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+unsubscr...@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/f0e4bccc-2de6-4018-bd48-d3573ad60e6b%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.