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

scm-commit at wald.intevation.org scm-commit at wald.intevation.org
Thu Mar 1 15:40:07 CET 2012


Author: ludwig
Date: 2012-03-01 15:40:07 +0100 (Thu, 01 Mar 2012)
New Revision: 5841

Modified:
   base/trunk/mpulsweb/controllers/evaluation_overview.py
Log:
Issue 1265: don't use dd_mm_YYYY with string.
In evaluation_overview.py modify _get_datadump to return a date instead
of an string. The function dd_mm_YYYY needs a date input. 



Modified: base/trunk/mpulsweb/controllers/evaluation_overview.py
===================================================================
--- base/trunk/mpulsweb/controllers/evaluation_overview.py	2012-03-01 14:18:55 UTC (rev 5840)
+++ base/trunk/mpulsweb/controllers/evaluation_overview.py	2012-03-01 14:40:07 UTC (rev 5841)
@@ -1,5 +1,6 @@
 # -*- coding: utf-8 -*-
 import logging
+from datetime import date
 
 import formencode
 
@@ -248,7 +249,9 @@
                 conn = db.getConnection()
                 cur = conn.cursor()
                 cur.execute("SELECT value FROM dbinfo WHERE key = 'datadump'")
-                v_dataset = str(cur.fetchone()[0])
+                datestr = cur.fetchone()[0]
+                y,m,d = datestr.split('-')
+                v_dataset = date(int(y), int(m), int(d))
             except:
                 log.exception('Error: get datadump failed')
         finally:



More information about the Mpuls-commits mailing list