> Seems like you're seeing this:http://code.djangoproject.com/ticket/10060 Yes, It's a big bug.
> Try to add distinct() to query set. It's work.. Thanks Alex... distinct is not very fast but it's last way to fix the problem... Proper query: e = File.objects.annotate(comment_cnt=Count('comment', distinct=True), visit_cnt=Count('visit', distinct=True)).order_by('comment_cnt') regards. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---