소스 검색

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):