aboutsummaryrefslogtreecommitdiff
path: root/scripts/steuermann_report.cgi
diff options
context:
space:
mode:
authorsienkiew <sienkiew@d34015c8-bcbb-4646-8ac8-8ba5febf221d>2013-08-15 10:09:53 -0400
committersienkiew <sienkiew@d34015c8-bcbb-4646-8ac8-8ba5febf221d>2013-08-15 10:09:53 -0400
commitb55ca4d2cbe3527f9cef3498e60d5514db941e80 (patch)
treea445787cd7528f81d2b896b26a25e688102282ea /scripts/steuermann_report.cgi
parenta4b5a4157c61ea4a106c3d6ab73b26b24052250a (diff)
downloadsteuermann-b55ca4d2cbe3527f9cef3498e60d5514db941e80.tar.gz
add count of errors to list of runs
git-svn-id: https://svn.stsci.edu/svn/ssb/etal/steuermann/trunk@1017 d34015c8-bcbb-4646-8ac8-8ba5febf221d
Diffstat (limited to 'scripts/steuermann_report.cgi')
-rw-r--r--scripts/steuermann_report.cgi17
1 files changed, 14 insertions, 3 deletions
diff --git a/scripts/steuermann_report.cgi b/scripts/steuermann_report.cgi
index e3bcf5e..c05b030 100644
--- a/scripts/steuermann_report.cgi
+++ b/scripts/steuermann_report.cgi
@@ -178,13 +178,24 @@ elif action == 'runs' :
elif x == 'time_desc' :
order ='create_time DESC'
- c.execute('SELECT DISTINCT run, create_time FROM sm_runs ORDER BY %s'%order)
+ c.execute('SELECT run, create_time, errors FROM sm_runs ORDER BY %s'%order)
print "<table>"
- for run, create_time in c :
+ for run, create_time, errors in c :
+ if errors is None :
+ c2 = db.cursor()
+ c2.execute("select count(*) from sm_status where run = ? and status > '0' and status < 'A'", (run,))
+ errors = c2.fetchone()
+ errors = errors[0]
+ # I was thinking of caching the computed value back into
+ # the sm_runs table and then invalidating it any time we add
+ # to the sm_status, but it is so fast that I don't need that
+ # optimization right now.
print "<tr>"
print "<td>"
print "<a href=%s?action=status&run=%s>%s</a>"%(cginame, run, run)
- print "</td><td>"
+ print "</td>"
+ print "<td>%s</td>"%errors
+ print "<td>"
if permission_modify :
print "<a href=%s?action=delete&run=%s>delete</a>"%(cginame, run)
print "</td>"