[Mpuls-commits] r5338 - base/trunk/mpulsweb/controllers

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Wed Sep 14 21:30:02 CEST 2011


Author: bh
Date: 2011-09-14 21:30:02 +0200 (Wed, 14 Sep 2011)
New Revision: 5338

Modified:
   base/trunk/mpulsweb/controllers/meta.py
Log:
Use the from_python method of the MetaSearchForm validator to convert
the values for the initial rendering of the meta search form instead of
converting e.g. the birthdate explicitly with format_date.


Modified: base/trunk/mpulsweb/controllers/meta.py
===================================================================
--- base/trunk/mpulsweb/controllers/meta.py	2011-09-14 19:21:43 UTC (rev 5337)
+++ base/trunk/mpulsweb/controllers/meta.py	2011-09-14 19:30:02 UTC (rev 5338)
@@ -208,9 +208,8 @@
         if id is None:
             id = session.get('case').id
         c.case = self._loadCase(id)
-        form_defaults = c.case.getHashFields()
-        form_defaults['birthname'] = form_defaults.get('birthname')
-        form_defaults['birthdate'] = format_date(form_defaults.get('birthdate'))
+        validator = MetaSearchForm()
+        form_defaults = validator.from_python(c.case.getHashFields())
         form = render('meta/search.mako')
         c.fields = []
         return formencode.htmlfill.render(form, defaults=form_defaults,



More information about the Mpuls-commits mailing list