Commit e63545c4 authored by 赵威's avatar 赵威

sort with order

parent 3c92e69b
......@@ -42,7 +42,8 @@ def user_portrait_scan_info():
def _dict_to_name_score(d):
res = []
for (k, v) in d.items():
new_d = dict(sorted(d.items(), key=lambda x: x[1], reverse=True))
for (k, v) in new_d.items():
res.append({"name": k, "score": float(v)})
return res
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment