Re: Django annotate with Count() problem

2009-03-20 Thread eli
> 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',

Re: Django annotate with Count() problem

2009-03-20 Thread Alex Koshelev
Try to add distinct() to query set. On Fri, Mar 20, 2009 at 10:06 PM, eli wrote: > > Hi, > > I have a problem with Django Orm annotate method.. > > My models (application: app): > > class File(models.Model): >  name = models.CharField(max_length=255) >  file = MyFileField(upload_to=...) > > clas

Re: Django annotate with Count() problem

2009-03-20 Thread eli
I'm using latest SVN version of Django (10105 revision) 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

Re: Django annotate with Count() problem

2009-03-20 Thread Alex Gaynor
On Fri, Mar 20, 2009 at 3:06 PM, eli wrote: > > Hi, > > I have a problem with Django Orm annotate method.. > > My models (application: app): > > class File(models.Model): > name = models.CharField(max_length=255) > file = MyFileField(upload_to=...) > > class Visit(models.Model): > file = model

Django annotate with Count() problem

2009-03-20 Thread eli
Hi, I have a problem with Django Orm annotate method.. My models (application: app): class File(models.Model): name = models.CharField(max_length=255) file = MyFileField(upload_to=...) class Visit(models.Model): file = models.ForeignKey(File) class Comment(models.Model): file = models