dabo Commit
Revision 4242
Date: 2008-07-07 06:28:11 -0700 (Mon, 07 Jul 2008)
Author: Ed
Trac: http://svn.dabodev.com/trac/dabo/changeset/4242

Changed:
U   trunk/dabo/dObject.py

Log:
Fixed a problem reported by Uwe Grauer with values for int-type properties 
being stored in a float format.


Diff:
Modified: trunk/dabo/dObject.py
===================================================================
--- trunk/dabo/dObject.py       2008-07-06 19:36:01 UTC (rev 4241)
+++ trunk/dabo/dObject.py       2008-07-07 13:28:11 UTC (rev 4242)
@@ -60,7 +60,14 @@
                                        continue
                                typ = type(getattr(self, prop))
                                if not issubclass(typ, basestring):
-                                       val = typ(val)
+                                       try:
+                                               val = typ(val)
+                                       except ValueError, e:
+                                               # Sometimes int values can be 
stored as floats
+                                               if typ in (int, long):
+                                                       val = float(val)
+                                               else:
+                                                       raise e
                                properties[prop] = val
 
                # The keyword properties can come from either, both, or none of:




_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev
Searchable Archives: http://leafe.com/archives/search/dabo-dev
This message: http://leafe.com/archives/byMID/[EMAIL PROTECTED]

Reply via email to