[Erp5-report] r27825 - in /erp5/trunk/products/ZSQLCatalog: SearchKey/ tests/

nobody at svn.erp5.org nobody at svn.erp5.org
Tue Jun 30 03:22:57 CEST 2009


Author: tatuya
Date: Tue Jun 30 03:22:57 2009
New Revision: 27825

URL: http://svn.erp5.org?rev=27825&view=rev
Log:
to make DateTimeKey accept None value and to make it generate "is NULL"
expressions

Modified:
    erp5/trunk/products/ZSQLCatalog/SearchKey/DateTimeKey.py
    erp5/trunk/products/ZSQLCatalog/tests/testSQLCatalog.py

Modified: erp5/trunk/products/ZSQLCatalog/SearchKey/DateTimeKey.py
URL: http://svn.erp5.org/erp5/trunk/products/ZSQLCatalog/SearchKey/DateTimeKey.py?rev=27825&r1=27824&r2=27825&view=diff
==============================================================================
--- erp5/trunk/products/ZSQLCatalog/SearchKey/DateTimeKey.py [utf8] (original)
+++ erp5/trunk/products/ZSQLCatalog/SearchKey/DateTimeKey.py [utf8] Tue Jun 30 03:22:57 2009
@@ -54,6 +54,8 @@
 
 @profiler_decorator
 def castDate(value):
+  if value is None:
+    return None
   date_kw = {'datefmt': 'international'}
   if isinstance(value, dict):
     # Convert value into a DateTime, and guess desired delta from what user

Modified: erp5/trunk/products/ZSQLCatalog/tests/testSQLCatalog.py
URL: http://svn.erp5.org/erp5/trunk/products/ZSQLCatalog/tests/testSQLCatalog.py?rev=27825&r1=27824&r2=27825&view=diff
==============================================================================
--- erp5/trunk/products/ZSQLCatalog/tests/testSQLCatalog.py [utf8] (original)
+++ erp5/trunk/products/ZSQLCatalog/tests/testSQLCatalog.py [utf8] Tue Jun 30 03:22:57 2009
@@ -277,6 +277,8 @@
                    ReferenceQuery(operator='<', date=DateTime('2008/02/02 10:10:11 UTC'))
                  , operator='and'), operator='and'),
                  {column: '2008/02/02 10:10:10 UTC'})
+    self.catalog(ReferenceQuery(ReferenceQuery(operator='is', date=None), operator='and'),
+                 {column: None}, check_search_text=False)
         
   def test_DateTimeKey(self):
     self._testDateTimeKey('date')




More information about the Erp5-report mailing list