def tags_cloud(): '''Get dict of tags, numbers.''' tags = Tags.all() tags_dict = [] for tag in tags: tags_dict.append({'name': tag.name, 'size': tag.count * 10}) return tags_dict