From: Joerg Jaspert Date: Sun, 30 Nov 2014 13:08:16 +0000 (+0100) Subject: dakweb: Allow to query for all source packages X-Git-Url: https://git.decadent.org.uk/gitweb/?a=commitdiff_plain;h=d768d3d67c0b90cc63c768a845cf8650cfe4c7ab;p=dak.git dakweb: Allow to query for all source packages --- 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)