Monday, February 21, 2011

Retrieving tags for a specific queryset with django-tagging

I'm using django-tagging, and am trying to retrieve a list of tags for a specific queryset. Here's what I've got:

tag      = Tag.objects.get(name='tag_name')
queryset = TaggedItem.objects.get_by_model(Article, tag)
tags     = Tag.objects.usage_for_queryset(queryset, counts=True)

"queryset" appropriately returns a number of articles that have been tagged with the tag 'tag_name', but when I attempt to retrieve all of the tags for that queryset, "tags" returns a complete list of all tags for that model.

Anyone else run into this before, or is this a bug in django-tagging?

From stackoverflow

0 comments:

Post a Comment