def elephantblog_tag_cloud(**kwargs): """ Retrieves used categories and calculates sizes of font used based on usage count of particular category. Used for tag cloud. """ steps = kwargs.get('steps', 4) distribution = kwargs.get('distribution', 'LINEAR') categories = get_usage(Category, counts=True) return calculate_cloud(categories, steps, _distribution_mapping[distribution])
def extra_content(self): return {'cloudtags': calculate_cloud(get_usage(), 10)}
def render(self, **kwargs): categories = get_usage(Category, counts=True) cloud = calculate_cloud(categories, self.steps, self.computingtype) return render_to_string([ 'content/elephantblog/tagcloud.html', ], {'content': self, 'cloud' : cloud})