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

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Fri Apr 15 12:37:11 CEST 2011


Author: bh
Date: 2011-04-15 12:37:11 +0200 (Fri, 15 Apr 2011)
New Revision: 4911

Modified:
   base/trunk/ChangeLog
   base/trunk/mpulsweb/controllers/evaluate.py
   base/trunk/mpulsweb/lib/validators.py
Log:
* mpulsweb/controllers/evaluate.py (get_search_options): Use
selected_ids as is. The conversion to string is done by the
EvaluationFormValidator.

* mpulsweb/lib/validators.py
(EvaluationFormValidator.selected_ids): Add from_python
converter. We already have the to_python converter here and by
moving the corresponding from_python converter here we have all
the code that converts the ids between a list of ints and string
in one place.


Modified: base/trunk/ChangeLog
===================================================================
--- base/trunk/ChangeLog	2011-04-15 10:02:26 UTC (rev 4910)
+++ base/trunk/ChangeLog	2011-04-15 10:37:11 UTC (rev 4911)
@@ -1,5 +1,18 @@
 2011-04-15  Bernhard Herzog  <bh at intevation.de>
 
+	* mpulsweb/lib/validators.py
+	(EvaluationFormValidator.selected_ids): Add from_python
+	converter. We already have the to_python converter here and by
+	moving the corresponding from_python converter here we have all
+	the code that converts the ids between a list of ints and string
+	in one place.
+
+	* mpulsweb/controllers/evaluate.py (get_search_options): Use
+	selected_ids as is. The conversion to string is done by the
+	EvaluationFormValidator.
+
+2011-04-15  Bernhard Herzog  <bh at intevation.de>
+
 	* mpulsweb/controllers/evaluate.py: Remove some redundant
 	assignments. They code used to perform a type conversion (date to
 	formatted string), but the conversion was removed in r3952,

Modified: base/trunk/mpulsweb/controllers/evaluate.py
===================================================================
--- base/trunk/mpulsweb/controllers/evaluate.py	2011-04-15 10:02:26 UTC (rev 4910)
+++ base/trunk/mpulsweb/controllers/evaluate.py	2011-04-15 10:37:11 UTC (rev 4911)
@@ -51,7 +51,7 @@
 def get_search_options(soptions=None, id=None, selected_ids=(), id_field=None, sql_where=None):
     options = {}
     options['id'] = id
-    options["selected_ids"] = " ".join(map(unicode, selected_ids))
+    options["selected_ids"] = selected_ids
     options["id_field"] = id_field 
     options["sql_where"] = sql_where
     options['typelist'] = c.evalconfig.get_evaluations()

Modified: base/trunk/mpulsweb/lib/validators.py
===================================================================
--- base/trunk/mpulsweb/lib/validators.py	2011-04-15 10:02:26 UTC (rev 4910)
+++ base/trunk/mpulsweb/lib/validators.py	2011-04-15 10:37:11 UTC (rev 4911)
@@ -676,6 +676,7 @@
     id_field = String(if_missing=None)
     selected_ids = Wrapper(to_python=lambda s: [int(item)
                                                 for item in s.split()],
+                           from_python=lambda ids: " ".join(map(unicode, ids)),
                            if_missing=None)
 
 



More information about the Mpuls-commits mailing list