commit-gnue
[Top][All Lists]
Advanced

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

[gnue] r8568 - branches/forms-0.5/src/GFObjects


From: johannes
Subject: [gnue] r8568 - branches/forms-0.5/src/GFObjects
Date: Fri, 18 Aug 2006 02:35:08 -0500 (CDT)

Author: johannes
Date: 2006-08-18 02:35:07 -0500 (Fri, 18 Aug 2006)
New Revision: 8568

Modified:
   branches/forms-0.5/src/GFObjects/GFBlock.py
Log:
A boolean field in a query set to False will also match NULL-values


Modified: branches/forms-0.5/src/GFObjects/GFBlock.py
===================================================================
--- branches/forms-0.5/src/GFObjects/GFBlock.py 2006-08-17 14:32:41 UTC (rev 
8567)
+++ branches/forms-0.5/src/GFObjects/GFBlock.py 2006-08-18 07:35:07 UTC (rev 
8568)
@@ -967,6 +967,13 @@
                               ])
           match = True
           break
+
+      if not match and isinstance(val, bool) and not val:
+          conditions.append(['or', \
+                  ['eq', ['field', entry.field], ['const', val]],
+                  ['null', ['field', entry.field]]])
+          match = True
+
       
       # Falls through to old behaviour if no : condition given or 
       # the : condition is unknown
@@ -989,7 +996,7 @@
   lpf = [['like', ['field', f], ['const', v]] for (f, v) in condLike.items ()]
 
   if epf or lpf or conditions:
-    result = GConditions.buildConditionFromPrefix (['and'] + epf + 
+    result = GConditions.buildConditionFromPrefix (['and'] + epf +
                                                    lpf + conditions)
 
   else:





reply via email to

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