Commit ae657efd authored by Tatuya Kamada's avatar Tatuya Kamada

to make DateTimeKey accept None value and to make it generate "is NULL"

expressions


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@27825 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 27387026
......@@ -54,6 +54,8 @@ def _DateTime(*args, **kw):
@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
......
......@@ -277,6 +277,8 @@ class TestSQLCatalog(unittest.TestCase):
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')
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment