diff options
author | mbligh <mbligh@592f7852-d20e-0410-864c-8624ca9c26a4> | 2007-10-05 15:13:06 +0000 |
---|---|---|
committer | mbligh <mbligh@592f7852-d20e-0410-864c-8624ca9c26a4> | 2007-10-05 15:13:06 +0000 |
commit | 853ab582207c385efd50a0cf132a57e8f53306f2 (patch) | |
tree | b292ae7a2a11d1773ce384037b9bc191128d2958 /tko/frontend.py | |
parent | 31e273a8169e74db7db41a6ae679d44f217fcc27 (diff) |
Extensions to SQL abstractions
Signed-off-by: Martin J. Bligh <mbligh@google.com>
Add more generalized select statement, allow where to be a
string as instead of a dictionary, add an update function.
git-svn-id: svn://test.kernel.org/autotest/trunk@755 592f7852-d20e-0410-864c-8624ca9c26a4
Diffstat (limited to 'tko/frontend.py')
-rwxr-xr-x | tko/frontend.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/tko/frontend.py b/tko/frontend.py index c48c5a18..7ffe8d24 100755 --- a/tko/frontend.py +++ b/tko/frontend.py @@ -64,6 +64,15 @@ class test: return tests + @classmethod + def select_sql(klass, db, sql, values): + fields = ['test_idx', 'job_idx', 'test', 'subdir', + 'kernel_idx', 'status', 'reason', 'machine_idx'] + fields = ['t.'+field for field in fields] + rows = db.select_sql(','.join(fields), 'tests', sql, values) + return [klass(db, *row) for row in rows] + + def __init__(self, db, test_idx, job_idx, testname, subdir, kernel_idx, status_num, reason, machine_idx): self.idx = test_idx self.job = job(db, job_idx) |