Oh, no, that wouldn't work with CharField. Or, maybe I'm doing something wrong.
About a queryset - I mistaken aggregate() for annotate(). On 19 янв, 14:52, "[CPR]-AL.exe" <cpr.al....@gmail.com> wrote: > Wait, whhhhat... o.O I'l try that now, thx. > > > > > > > > > > On Wed, Jan 19, 2011 at 2:50 PM, Tom Evans <tevans...@googlemail.com> wrote: > > On Wed, Jan 19, 2011 at 11:26 AM, [CPR]-AL.exe <cpr.al....@gmail.com> > > wrote: > > > Hmm, yeah, but that still iterates over the objects and filters out > > > them by count on the application server, not on the database one :( > > > > I'm bypassing it already in my running project, but I try to avoid > > > using raw sql as longer as it is possible. So, the question, actually > > > remains open. > > > > It should go something like [pseudo-code]: > > > Book.objects.values('tablefield').annotate(Count('tablefield')).filter('tab > > lefield__count__gte > > > = 1) > > > > But, of course, that wouldn't work, because annotate's return value is > > > not a queryset :( > > > Er, says who? > > > Organization.objects.annotate(num_grps=Count('usergroup')).filter(num_grps_ > > _gt=2).values_list('id', > > flat=True) > > [6L, 36L, 19L, 20L, 24L, 32L, 33L, 35L] > > > Cheers > > > Tom > > > -- > > 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<django-users%2Bunsubscribe@google > > groups.com> > > . > > For more options, visit this group at > >http://groups.google.com/group/django-users?hl=en. > > -- > Sincerely yours, Alexey. -- 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.