[Mpuls-commits] r5220 - base/trunk/mpulsweb/lib

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Wed Aug 3 09:45:40 CEST 2011


Author: torsten
Date: 2011-08-03 09:45:39 +0200 (Wed, 03 Aug 2011)
New Revision: 5220

Modified:
   base/trunk/mpulsweb/lib/search.py
Log:
?\195?\156berschreibe die Funktion "validate_form_params" in der Auswertungssuche, so
das hier der spezielle Validator verwendet wird (mit federal_state)


Modified: base/trunk/mpulsweb/lib/search.py
===================================================================
--- base/trunk/mpulsweb/lib/search.py	2011-08-03 07:44:20 UTC (rev 5219)
+++ base/trunk/mpulsweb/lib/search.py	2011-08-03 07:45:39 UTC (rev 5220)
@@ -526,6 +526,16 @@
         self.retrieve_fields = retrieve_fields
         self.match_fields = match_fields
 
+    def validate_form_params(self, params):
+        # FIXME: We import SearchCaseForm here because importing it
+        # during import doesn't work.  The validators module performs
+        # translations and accesses app_globals during import, so it has
+        # to be imported when a HTTP-request is being handled.  The
+        # search module is imported early on when the application starts
+        # so validators cannot be imported then.
+        from mpulsweb.lib.validators import EvaluationSearchCaseForm
+        return EvaluationSearchCaseForm().to_python(params)
+
     def get_needle_clause(self, options):
         """Return the search condition to select cases based on search terms.
         Derived classes may override this method if necessary.



More information about the Mpuls-commits mailing list