server/sources/rql2sql.py
branchstable
changeset 7704 0f49dd8e76b5
parent 7672 f31f9882c90f
child 7707 936530f8d32c
--- a/server/sources/rql2sql.py	Tue Jul 26 16:50:06 2011 +0200
+++ b/server/sources/rql2sql.py	Wed Jul 27 12:26:57 2011 +0200
@@ -1438,15 +1438,15 @@
         value = constant.value
         if constant.type == 'etype':
             return value
-        if constant.type == 'Int' and  isinstance(constant.parent, SortTerm):
-            return value
+        if constant.type == 'Int': # XXX Float?
+            return str(value)
         if constant.type in ('Date', 'Datetime'):
             rel = constant.relation()
             if rel is not None:
                 rel._q_needcast = value
             return self.keyword_map[value]()
         if constant.type == 'Boolean':
-            value = self.dbhelper.boolean_value(value)
+            return self.dbhelper.boolean_value(value)
         if constant.type == 'Substitute':
             try:
                 # we may found constant from simplified var in varmap