refactor
This commit is contained in:
parent
c2c6e331d7
commit
61d599f727
1 changed files with 3 additions and 1 deletions
4
tasks.py
4
tasks.py
|
@ -44,7 +44,9 @@ def update_keywords():
|
||||||
for a in annotation.models.Annotation.objects.filter(layer='keywords').all().values('value')
|
for a in annotation.models.Annotation.objects.filter(layer='keywords').all().values('value')
|
||||||
])
|
])
|
||||||
data = ['<ul>']
|
data = ['<ul>']
|
||||||
for k in sorted(keywords.keys(), key=lambda k: ox.sort_string('%s %s' % (keywords[k], k)), reverse=True):
|
def s(k):
|
||||||
|
return ox.sort_string('%s %s' % (10000-keywords[k], k)).lower()
|
||||||
|
for k in sorted(keywords.keys(), key=s):
|
||||||
data.append('<li>%d <a href="/clip/keywords==%s">%s</a>' %((keywords[k], k.replace(' ', '_'), k)))
|
data.append('<li>%d <a href="/clip/keywords==%s">%s</a>' %((keywords[k], k.replace(' ', '_'), k)))
|
||||||
data.append('</ul>')
|
data.append('</ul>')
|
||||||
t.text = '\n'.join(data)
|
t.text = '\n'.join(data)
|
||||||
|
|
Loading…
Reference in a new issue