Commit 6dc934e9 authored by Sebastien Robin's avatar Sebastien Robin

make sure the min max feature of buildSqlQuery works fine with dates


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@2733 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 84a48ea8
...@@ -1398,13 +1398,13 @@ class Catalog(Folder, Persistent, Acquisition.Implicit, ExtensionClass.Base): ...@@ -1398,13 +1398,13 @@ class Catalog(Folder, Persistent, Acquisition.Implicit, ExtensionClass.Base):
query_min = min(query_value) query_min = min(query_value)
query_max = max(query_value) query_max = max(query_value)
if range_value == 'min' : if range_value == 'min' :
query_item += ['%s >= %s' % (key, str(query_min)) ] query_item += ["%s >= '%s'" % (key, str(query_min)) ]
elif range_value == 'max' : elif range_value == 'max' :
query_item += ['%s < %s' % (key, str(query_max)) ] query_item += ["%s < '%s'" % (key, str(query_max)) ]
elif range_value == 'minmax' : elif range_value == 'minmax' :
query_item += ['%s >= %s and %s < %s' % (key, str(query_min), key, str(query_max)) ] query_item += ["%s >= '%s' and %s < '%s'" % (key, str(query_min), key, str(query_max)) ]
elif range_value == 'ngt' : elif range_value == 'ngt' :
query_item += ['%s <= %s' % (key, str(query_max)) ] query_item += ["%s <= '%s'" % (key, str(query_max)) ]
else : else :
for query_value_item in query_value : for query_value_item in query_value :
query_item += ['%s = %s' % (key, str(query_value_item))] query_item += ['%s = %s' % (key, str(query_value_item))]
......
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