summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWill Woods <wwoods@redhat.com>2009-09-30 10:37:39 -0400
committerWill Woods <wwoods@redhat.com>2009-09-30 10:37:39 -0400
commit9806e8e861166fafc42fb386e459b35cff05d684 (patch)
tree91b5217eaa8251dfaa7ab550b9df9917944ee4a1
parentbc8a05e1355110a16faa7dedf27ee72ca68488cc (diff)
downloadisrawhidebroken-9806e8e861166fafc42fb386e459b35cff05d684.tar.gz
israwhidebroken-9806e8e861166fafc42fb386e459b35cff05d684.tar.xz
israwhidebroken-9806e8e861166fafc42fb386e459b35cff05d684.zip
Move some code from the template to the controller
-rw-r--r--israwhidebroken/controllers.py14
-rw-r--r--israwhidebroken/templates/index.html7
2 files changed, 11 insertions, 10 deletions
diff --git a/israwhidebroken/controllers.py b/israwhidebroken/controllers.py
index b3af09c..7a8f882 100644
--- a/israwhidebroken/controllers.py
+++ b/israwhidebroken/controllers.py
@@ -23,12 +23,20 @@ class Root(controllers.RootController):
c = to_int(c)
next = Tree.select(Tree.q.compose_id > c).min('compose_id')
prev = Tree.select(Tree.q.compose_id < c).max('compose_id')
- # FIXME BLUH WIDGETIFY THIS
+
+ trees = Tree.selectBy(compose_id=c)
+ tests = Test.select(Test.q.id <= 14)
+ results = {}
+ for tree in trees:
+ rdict = dict([(t.id, None) for t in tests])
+ for r in tree.results:
+ rdict[r.testID] = r
+ results[tree.id] = rdict
+
return dict(c=c, prev=prev, next=next,
in_qa='qa' in identity.current.groups,
admin='qa-admin' in identity.current.groups,
- tests=Test.select(),
- trees=Tree.selectBy(compose_id=c))
+ tests=tests, trees=trees, results=results)
# JSON RPC calls
@expose(allow_json=True)
diff --git a/israwhidebroken/templates/index.html b/israwhidebroken/templates/index.html
index 94b6866..86968dd 100644
--- a/israwhidebroken/templates/index.html
+++ b/israwhidebroken/templates/index.html
@@ -15,13 +15,6 @@
def rclass(r):
if r is None: return None
return r.result and 'pass' or 'fail'
-
-results = {}
-for tree in trees:
- rdict = dict([(t.id, None) for t in tests])
- for r in tree.results:
- rdict[r.testID] = r
- results[tree.id] = rdict
?>
<body>