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

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Wed Oct 13 15:30:33 CEST 2010


Author: bh
Date: 2010-10-13 15:30:33 +0200 (Wed, 13 Oct 2010)
New Revision: 3973

Modified:
   base/trunk/ChangeLog
   base/trunk/mpulsweb/controllers/evaluate.py
   base/trunk/mpulsweb/lib/config.py
Log:
Implement main part of mpuls/issue1266

* mpulsweb/controllers/evaluate.py (get_search_options): Use
mpuls_config.get_date instead of mpuls_config.get to fetch the
configuration values of 'search', 'default-start-date' and
'search', 'default-end-date' so that they can be specified a
strings and then overwritten in mpuls applications.

* mpulsweb/lib/config.py (MpulsAppConfig.build_defaults): Use
strings instead of date objects as the defaults for 'search',
'default-start-date' and 'search', 'default-end-date'


Modified: base/trunk/ChangeLog
===================================================================
--- base/trunk/ChangeLog	2010-10-13 13:18:59 UTC (rev 3972)
+++ base/trunk/ChangeLog	2010-10-13 13:30:33 UTC (rev 3973)
@@ -1,5 +1,19 @@
 2010-10-13  Bernhard Herzog  <bh at intevation.de>
 
+	Implement main part of mpuls/issue1266
+
+	* mpulsweb/lib/config.py (MpulsAppConfig.build_defaults): Use
+	strings instead of date objects as the defaults for 'search',
+	'default-start-date' and 'search', 'default-end-date'
+
+	* mpulsweb/controllers/evaluate.py (get_search_options): Use
+	mpuls_config.get_date instead of mpuls_config.get to fetch the
+	configuration values of 'search', 'default-start-date' and
+	'search', 'default-end-date' so that they can be specified a
+	strings and then overwritten in mpuls applications.
+
+2010-10-13  Bernhard Herzog  <bh at intevation.de>
+
 	* mpulsweb/lib/config.py (MpulsAppConfig.get_date): New.  Return a
 	configuration setting as a date object.
 

Modified: base/trunk/mpulsweb/controllers/evaluate.py
===================================================================
--- base/trunk/mpulsweb/controllers/evaluate.py	2010-10-13 13:18:59 UTC (rev 3972)
+++ base/trunk/mpulsweb/controllers/evaluate.py	2010-10-13 13:30:33 UTC (rev 3973)
@@ -69,8 +69,9 @@
 
     # set default evaluation options.
     options['phase'] = g.mpuls_config.get('evaluations', 'default-phases')
-    options['start_date'] = g.mpuls_config.get('search', 'default-start-date')
-    options['end_date'] = g.mpuls_config.get('search', 'default-end-date')
+    options['start_date'] = g.mpuls_config.get_date('search',
+                                                    'default-start-date')
+    options['end_date'] = g.mpuls_config.get_date('search', 'default-end-date')
 
     # copy options from soptions if included there
     if soptions:

Modified: base/trunk/mpulsweb/lib/config.py
===================================================================
--- base/trunk/mpulsweb/lib/config.py	2010-10-13 13:18:59 UTC (rev 3972)
+++ base/trunk/mpulsweb/lib/config.py	2010-10-13 13:30:33 UTC (rev 3973)
@@ -310,8 +310,8 @@
         set('search', 'cm_defaults', search_cm_default)
         set('search', 'default-sorting', 'id')
         set('search', 'default-order', 'asc')
-        set('search', 'default-start-date', datetime.date(2009, 9, 1))
-        set('search', 'default-end-date', datetime.date(2010, 8, 31))
+        set('search', 'default-start-date', "2009-09-01")
+        set('search', 'default-end-date', "2010-08-31")
 
         # LOGBOOK
         # -------



More information about the Mpuls-commits mailing list