[Mpuls-commits] r1960 - wasko/branches/2.0/mpulsweb/lib

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Tue Mar 16 10:14:03 CET 2010


Author: torsten
Date: 2010-03-16 10:14:01 +0100 (Tue, 16 Mar 2010)
New Revision: 1960

Modified:
   wasko/branches/2.0/mpulsweb/lib/validators.py
Log:
* mpulsweb/lib/validators.py: Added EvaluationFormValidator.


Modified: wasko/branches/2.0/mpulsweb/lib/validators.py
===================================================================
--- wasko/branches/2.0/mpulsweb/lib/validators.py	2010-03-16 09:13:14 UTC (rev 1959)
+++ wasko/branches/2.0/mpulsweb/lib/validators.py	2010-03-16 09:14:01 UTC (rev 1960)
@@ -11,7 +11,7 @@
      DateConverter, DateValidator, TimeConverter, FormValidator, MaxLength, \
      FileUploadKeeper, FieldStorageUploadConverter
 
-from pylons import session
+from pylons import session, app_globals as g
 from pylons.i18n import _
 
 from mpulsweb.lib.db import db
@@ -531,4 +531,22 @@
     case_id = Int()
     standin = ForEach(Int())
 
+class EvaluationFormValidator(BaseFormValidator):
+
+    id = String(if_missing='0')
+    agencyid = String(if_missing=g.mpuls_config.get('common', 'agencyname'))
+
+    start_date = MyDateConverter(not_empty=True, if_missing='', month_style='dd.mm.jjjj')
+    end_date = MyDateConverter(not_empty=True, if_missing='', month_style='dd.mm.jjjj')
+
+    start_date_field = String(if_missing=g.mpuls_config.get('evaloptions',
+                                                   'default-start-date-field'))
+    end_date_field = String(if_missing=g.mpuls_config.get('evaloptions',
+                                                     'default-end-date-field'))
+
+    typelist = ForEach(String(), convert_to_list=True)
+    type_ending = ForEach(String(), convert_to_list=True)
+    phase = ForEach(String(), convert_to_list=True)
+    show_percent = Bool(if_missing=False)
+
 # vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8



More information about the Mpuls-commits mailing list