[Mpuls-commits] r5509 - base/trunk/mpulsweb/lib
scm-commit@wald.intevation.org
scm-commit at wald.intevation.org
Fri Oct 28 14:18:47 CEST 2011
Author: bricks
Date: 2011-10-28 14:18:47 +0200 (Fri, 28 Oct 2011)
New Revision: 5509
Modified:
base/trunk/mpulsweb/lib/export.py
Log:
Handle data types for excel export correctly
After looking at the pyExcelerator sources it was clear that
it can handle date, float, int, long and basestring data for cells.
Therefore these python objects MUST NOT be passed as string!
This commit finally fixes issue2538 (mpuls_s: Problem beim Export)
Modified: base/trunk/mpulsweb/lib/export.py
===================================================================
--- base/trunk/mpulsweb/lib/export.py 2011-10-28 11:46:27 UTC (rev 5508)
+++ base/trunk/mpulsweb/lib/export.py 2011-10-28 12:18:47 UTC (rev 5509)
@@ -292,11 +292,10 @@
if isinstance(value, (date, datetime)):
#style.num_format_str = "M/D/YY"
style.num_format_str = "DD.MM.YYYY"
- value = value.strftime("%d.%m.%Y")
return (value, style)
if isinstance(value, basestring) and len(value) > 32765:
value = value[:32765]
- if not isinstance(value, basestring):
+ if not isinstance(value, (basestring, int, long, float)):
return (str(value), style)
return (value, style)
More information about the Mpuls-commits
mailing list