TheGU / django-tagging

Automatically exported from code.google.com/p/django-tagging
Other
0 stars 0 forks source link

Suggestion: add a cloud_for_queryset method #137

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
TagManager has a cloud_for_model method, but for one of my apps I needed a
cloud_for_queryset method, which isn't there.

I actually wrote a function to achieve this in my app, but it would be nice
if this could be included as a method of TagManager instead, just as
cloud_for_model is a method.

Here is my function, but note this was in my app, it's not a method of
TagManager, although that should require minimal modifications:

def cloud_for_queryset(queryset, steps=4, distribution=LOGARITHMIC,
min_count=None):
    tags = list(Tag.objects.usage_for_queryset(queryset, counts=True,
min_count=min_count))
    return calculate_cloud(tags, steps, distribution)

Original issue reported on code.google.com by rob...@gmail.com on 22 Jul 2008 at 12:23

GoogleCodeExporter commented 9 years ago
Not a defect, but rather a suggestion, but I can't see how to change it somehow.

Original comment by rob...@gmail.com on 22 Jul 2008 at 12:25

GoogleCodeExporter commented 9 years ago

Original comment by doug.nap...@gmail.com on 12 Aug 2008 at 3:02

GoogleCodeExporter commented 9 years ago
I used the same method from above and it seems to work good. Please add it.

Original comment by google-c...@jensdiemer.de on 23 Sep 2011 at 12:20