I have 3 models. Something like this:
Writer:
content = ManyToMany(Content)
Content
tags = ManyToMany(Tag)
Tag
Now suppose I have a Tag, call it "tag1". The idea of the query is
that I want the Writers that have the most pieces of Content tagged
with tag1.
Theoretically, it'd be something like
Writer.objects.annotate(content_count=Count
("content__tags=tag1")).order_by('content_count")
Obviously, that doesn't work. Any help would be greatly appreciated.
Thanks!
-Andy
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---