commit-gnue
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gnue] r10109 - trunk/gnue-common/src/utils


From: reinhard
Subject: [gnue] r10109 - trunk/gnue-common/src/utils
Date: Wed, 9 Dec 2009 15:36:38 -0600 (CST)

Author: reinhard
Date: 2009-12-09 15:36:38 -0600 (Wed, 09 Dec 2009)
New Revision: 10109

Modified:
   trunk/gnue-common/src/utils/datatypes.py
Log:
Empty string in database means the same as NULL.


Modified: trunk/gnue-common/src/utils/datatypes.py
===================================================================
--- trunk/gnue-common/src/utils/datatypes.py    2009-12-09 21:06:51 UTC (rev 
10108)
+++ trunk/gnue-common/src/utils/datatypes.py    2009-12-09 21:36:38 UTC (rev 
10109)
@@ -64,8 +64,9 @@
     # everything in a single function helps improving the performance.
     #   -- Reinhard
 
-    if value is None:
-        # "None" is always valid, independent of data type
+    if value is None or value == "":
+        # "None" is always valid, independent of data type. We consider an
+        # empty string the same as None.
         result = None
 
     elif isinstance(value, InvalidValueType):





reply via email to

[Prev in Thread] Current Thread [Next in Thread]