dabo Commit
Revision 6256
Date: 2010-12-17 14:14:56 -0800 (Fri, 17 Dec 2010)
Author: Jacekk
Trac: http://trac.dabodev.com/changeset/6256

Changed:
U   trunk/dabo/lib/datanav/Page.py

Log:
Added support for callable selections and None as filter value.

Diff:
Modified: trunk/dabo/lib/datanav/Page.py
===================================================================
--- trunk/dabo/lib/datanav/Page.py      2010-12-17 21:24:58 UTC (rev 6255)
+++ trunk/dabo/lib/datanav/Page.py      2010-12-17 22:14:56 UTC (rev 6256)
@@ -302,6 +302,11 @@
                                        # boolean fields won't have a control; 
opVal will
                                        # be either 'Is True' or 'Is False'
                                        matchVal = (opVal == _(CHOICE_TRUE))
+                               elif callable(ctrl):
+                                       try:
+                                               matchVal = ctrl()
+                                       except AttributeError:
+                                               matchVal = None
                                else:
                                        matchVal = ctrl.Value
                                try:
@@ -326,7 +331,9 @@
                                        else:
                                                # "Begins With" or "Contains"
                                                opStr = "LIKE"
-                                               if opVal[:1] == "B":
+                                               if matchVal is None:
+                                                       matchStr = 
biz.escQuote("null")
+                                               elif opVal[:1] == "B":
                                                        matchStr = 
biz.escQuote(matchVal + "%")
                                                else:
                                                        matchStr = 
biz.escQuote("%" + matchVal + "%")



_______________________________________________
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