[Mpuls-commits] r208 - in waska/trunk: . waskaweb/lib

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Thu Oct 23 14:55:06 CEST 2008


Author: torsten
Date: 2008-10-23 14:55:05 +0200 (Thu, 23 Oct 2008)
New Revision: 208

Modified:
   waska/trunk/ChangeLog.txt
   waska/trunk/waskaweb/lib/evaluation.py
Log:
Fixed issue591


Modified: waska/trunk/ChangeLog.txt
===================================================================
--- waska/trunk/ChangeLog.txt	2008-10-21 14:33:39 UTC (rev 207)
+++ waska/trunk/ChangeLog.txt	2008-10-23 12:55:05 UTC (rev 208)
@@ -1,5 +1,12 @@
-2008-10-10	Sascha L. Teichmann <sascha.teichmann at intevation.de>
+2008-10-23	Torsten Irlaender  <torsten.irlaender at intevation.de>
 
+	Fixed issue591
+
+	* waskaweb/lib/evaluation.py: Fixed error of counting unique cases
+	which are taken as base for the evaluation. 
+
+2008-10-22	Sascha L. Teichmann <sascha.teichmann at intevation.de>
+
 	Fixed issue518
 
 	* waskaweb/lib/helpers.py: Use correct regular expression for date validation

Modified: waska/trunk/waskaweb/lib/evaluation.py
===================================================================
--- waska/trunk/waskaweb/lib/evaluation.py	2008-10-21 14:33:39 UTC (rev 207)
+++ waska/trunk/waskaweb/lib/evaluation.py	2008-10-23 12:55:05 UTC (rev 208)
@@ -844,19 +844,20 @@
         Evaluation.__init__(self, compressed_ids)
         self.export_label = _('cm_eval_header_effort') 
         self.export_eval_what = u"abgeschlossene Beratungsfälle"
-        self.sql  = """SELECT sum(l.dauer) AS dauer, count(l.dauer) AS anzahl, l.art 
+        self.sql  = """SELECT sum(l.dauer) AS dauer, count(l.dauer) AS anzahl, l.art, m.id 
             FROM ka_logbuch_tbl_view l
             JOIN master_tbl_eval_total_view m
             ON m.id = l.master_id
             WHERE m.phase = 7
             AND %s 
             AND l.dauer IS NOT NULL 
-            GROUP BY l.art 
+            GROUP BY l.art, m.id 
             ORDER BY l.art
         """ % self.where_clause(self.compressed_ids, "l.master_id")
 
     def perform(self):
         #{'art': [anzahl, dauer]}
+        unique_cases = []
         result = { '-2': [0,0],
                    '-1': [0,0],
                    '1': [0,0],
@@ -889,7 +890,11 @@
                 while True:
                     row = cur.fetchone()
                     if not row: break
-                    count += 1
+
+                    if row[3] not in unique_cases:
+                        count += 1
+                        unique_cases.append(row[3])
+
                     duration = int(h.timedelta_in_minutes(row[0]))
                     num      = row[1]
                     type     = str(row[2])



More information about the Mpuls-commits mailing list