On Wed, 2006-07-19 at 16:57 +0400, Ivan Sagalaev wrote:
> It can look like this:
> 
> Tag.objects.filter(document__tags__name='mytag').exclude(name='mytag')

Wow, that's short. Thanks.

The only thing I'm missing now is that this expression returns multiple
instances of each tag, while I need counts. I could write:

Tag.objects.filter(document__tags__name='mytag').exclude(name='mytag').distinct()

But then I'd lose the counts. I think I have to write myself a function
that will count the instances of each tag. 

-- 
Maciej Bliziński <[EMAIL PROTECTED]>
http://automatthias.wordpress.com


--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~----------~----~----~----~------~----~------~--~---

Reply via email to