diff options
author | Will Woods <wwoods@redhat.com> | 2009-09-18 16:46:04 -0400 |
---|---|---|
committer | Will Woods <wwoods@redhat.com> | 2009-09-18 16:46:04 -0400 |
commit | 2ff450618b3363c400ff1d64c9639a005f227f4b (patch) | |
tree | 0d68319dc87b07191e7bdc20b40e681c811c1ae9 | |
parent | 8ed9120f3a0a44704a076605db1b73cf068d65a6 (diff) | |
download | israwhidebroken-2ff450618b3363c400ff1d64c9639a005f227f4b.tar.gz israwhidebroken-2ff450618b3363c400ff1d64c9639a005f227f4b.tar.xz israwhidebroken-2ff450618b3363c400ff1d64c9639a005f227f4b.zip |
Rename list_tests to get_tests, add some comments
-rw-r--r-- | israwhidebroken/controllers.py | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/israwhidebroken/controllers.py b/israwhidebroken/controllers.py index a5e6c10..8e666ca 100644 --- a/israwhidebroken/controllers.py +++ b/israwhidebroken/controllers.py @@ -20,18 +20,14 @@ class Root(controllers.RootController): if not c: newest_tree = Tree.select(orderBy='-compose_id')[0] c = newest_tree.compose_id + # FIXME BLUH WIDGETIFY THIS return dict(in_qa='qa' in identity.current.groups, admin='qa-admin' in identity.current.groups, c=c, tests=Test.select(), trees=Tree.select(Tree.q.compose_id == c)) - # JSON RPC calls - @expose(allow_json=True) - def list_tests(self): - tests = Test.select() - return dict(tests=list(tests)) - + # Helpers for JSON calls def _tree_select(self, *args, **kw): qlist = [] for field in 'id', 'arch', 'compose_id', 'tree_time', 'repodata_time': @@ -43,6 +39,12 @@ class Root(controllers.RootController): print qlist return Tree.select(' AND '.join(qlist)) + # JSON RPC calls + @expose(allow_json=True) + def get_tests(self): + tests = Test.select() + return dict(tests=list(tests)) + @expose(allow_json=True) def get_trees(self, *args, **kw): tree_results = self._tree_select(*args, **kw) @@ -65,7 +67,10 @@ class Root(controllers.RootController): @identity.require(identity.in_group("qa")) @expose(allow_json=True) - def add_result(self, treeid, testid, result): + def add_result(self, treeid, testid, result, overwrite=False): + if not overwrite: + # TODO return an error if there's already a result here + pass tr = TestResult(tree=to_int(treeid), test=to_int(testid), result=to_int(result), |