[Mpuls-commits] r4189 - in base/trunk: . mpulsweb/controllers

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Tue Nov 16 11:36:42 CET 2010


Author: bh
Date: 2010-11-16 11:36:42 +0100 (Tue, 16 Nov 2010)
New Revision: 4189

Modified:
   base/trunk/ChangeLog
   base/trunk/mpulsweb/controllers/evaluate.py
Log:
* mpulsweb/controllers/evaluate.py
(EvaluateController.type_ending_clause): New.  Method to be
implemented by derived classes for searches based on the type of
ending.
(EvaluateController._get_evalparams): Add the return value of
type_ending_clause to the where_clauses list so that its used in
the search


Modified: base/trunk/ChangeLog
===================================================================
--- base/trunk/ChangeLog	2010-11-16 10:36:38 UTC (rev 4188)
+++ base/trunk/ChangeLog	2010-11-16 10:36:42 UTC (rev 4189)
@@ -1,3 +1,13 @@
+2010-11-16  Bernhard Herzog  <bh at intevation.de>
+
+	* mpulsweb/controllers/evaluate.py
+	(EvaluateController.type_ending_clause): New.  Method to be
+	implemented by derived classes for searches based on the type of
+	ending.
+	(EvaluateController._get_evalparams): Add the return value of
+	type_ending_clause to the where_clauses list so that its used in
+	the search
+
 2010-11-16  Torsten Irlaender <torsten at intevation.de>
 
 	* mpulsweb/controllers/phase.py: Moved translated strings into

Modified: base/trunk/mpulsweb/controllers/evaluate.py
===================================================================
--- base/trunk/mpulsweb/controllers/evaluate.py	2010-11-16 10:36:38 UTC (rev 4188)
+++ base/trunk/mpulsweb/controllers/evaluate.py	2010-11-16 10:36:42 UTC (rev 4189)
@@ -154,6 +154,8 @@
 
         where_clauses.append(selected_ids)
 
+        where_clauses.append(self.type_ending_clause(params))
+
         params['sql'] = ("SELECT %%(fields)s from master_tbl_eval_total_view m"
                          " WHERE %s " % (" AND ".join(where_clauses)))
 
@@ -167,6 +169,12 @@
             params['end_date_field'] = None
         return params
 
+    def type_ending_clause(self, params):
+        """Return the condition to search based on the type of ending.
+        Derived classes should override this if necessary as the details
+        are usually application specific.
+        """
+        return "TRUE"
 
     def evaluateAction(self):
         """Return an HTML file containing the result of one or more evaluations.



More information about the Mpuls-commits mailing list