From d768d3d67c0b90cc63c768a845cf8650cfe4c7ab Mon Sep 17 00:00:00 2001 From: Joerg Jaspert Date: Sun, 30 Nov 2014 14:08:16 +0100 Subject: [PATCH] dakweb: Allow to query for all source packages --- dakweb/queries/source.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/dakweb/queries/source.py b/dakweb/queries/source.py index 925435b1..36344b76 100755 --- a/dakweb/queries/source.py +++ b/dakweb/queries/source.py @@ -68,3 +68,28 @@ def sources_in_suite(suite=None): return json.dumps(ret) QueryRegister().register_path('/sources_in_suite', sources_in_suite) + + +@bottle.route('/all_sources') +def sources_in_suite(): + """ + all_sources() + + returns: list of dictionaries + + Returns all source packages and their versions known to the archive + (this includes NEW). + """ + + s = DBConn().session() + q = s.query(DBSource) + ret = [] + for p in q: + ret.append({'source': p.source, + 'version': p.version}) + + s.close() + + return json.dumps(ret) + +QueryRegister().register_path('/all_sources', all_sources) -- 2.39.5