From b55ca4d2cbe3527f9cef3498e60d5514db941e80 Mon Sep 17 00:00:00 2001 From: sienkiew Date: Thu, 15 Aug 2013 14:09:53 +0000 Subject: 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 --- scripts/steuermann_report.cgi | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'scripts/steuermann_report.cgi') 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 "" - 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 "" print "" + print ""%errors + print "" -- cgit
" print "%s"%(cginame, run, run) - print "" + print "%s" if permission_modify : print "delete"%(cginame, run) print "