fix display of ranked items
This commit is contained in:
parent
49ffaef3dc
commit
f7d0368e2f
|
@ -1173,14 +1173,14 @@ class RankedItemsField(WidgetField):
|
|||
r += htmltext('<ul>')
|
||||
items = value.items()
|
||||
items.sort(lambda x,y: cmp(x[1], y[1]))
|
||||
counter = 1
|
||||
counter = 0
|
||||
last_it = None
|
||||
for it in items:
|
||||
if it[1] is not None:
|
||||
r += htmltext('<li>%s: %s</li>') % (counter, it[0])
|
||||
if last_it != it[1]:
|
||||
counter += 1
|
||||
last_it = it[1]
|
||||
r += htmltext('<li>%s: %s</li>') % (counter, it[0])
|
||||
r += htmltext('</ul>')
|
||||
return r.getvalue()
|
||||
|
||||
|
|
Loading…
Reference in New Issue