[Twisted-web] flattener for decimal type

Andrea Arcangeli andrea at cpushare.com
Sat Jan 22 20:28:47 MST 2005


This avoids an exception when returning decimals through some data
method. Works for me so far (apparently I didn't need to import the
decimal module, not sure why ;).

Index: nevow/__init__.py
===================================================================
--- nevow/__init__.py	(revision 1110)
+++ nevow/__init__.py	(working copy)
@@ -209,6 +209,12 @@
 
 """
 
+flatteners_2_4 = """
+nevow.flat.flatstan.StringCastSerializer          decimal.Decimal
+"""
+if sys.version_info >= (2, 4):
+    flatteners += flatteners_2_4
+
 loadFlatteners(flatteners)
 
 



More information about the Twisted-web mailing list