浏览代码

sort sources

David 10 年之前
父节点
当前提交
98291a6567
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      web.py

+ 1 - 1
web.py

@@ -78,7 +78,7 @@ def get_article(art_id):
 @app.route(BASEPATH+'/sources/', methods=['GET'])
 @app.route(BASEPATH+'/sources', methods=['GET'])
 def get_sources():
-    return jsonify({'sources': d.sources()})
+    return jsonify({'sources': sorted(d.sources(), key=lambda k: k['name'].lower())})
 
 @app.route(BASEPATH+'/sources/<string:source_id>', methods=['GET'])
 def get_source(source_id):