The SSH host key has changed on 8 April, 2022 to this one: SHA256:573uTBSeh74kvOo0HJXi5ijdzRm8me27suzNEDlGyrQ

Changed lambda to itemgetter as suggested

master
Gergely Polonkai 9 years ago
parent 3893932ade
commit a99ca61159
  1. 3
      gergelypolonkai_django/taghelper.py

@ -1,6 +1,7 @@
from django.db.models import Count
from taggit.models import Tag
from math import floor
from operator import itemgetter
def tagcloud(request):
tagcloudlist = Tag.objects.annotate(ct=Count('taggit_taggeditem_items')).order_by('-ct')
@ -21,6 +22,6 @@ def tagcloud(request):
size = int(floor((5.0 * (tagcount - tmin)) / (tmax - tmin)))
tagcloud.append({'name': cloudelement.name, 'slug': cloudelement.slug, 'size': size})
tagcloud.sort(key=lambda k: k['name'])
tagcloud.sort(key=itemgetter('name'))
return {'tagcloud': tagcloud}

Loading…
Cancel
Save