# HG changeset patch # User Sylvain Thénault # Date 1284737158 -7200 # Node ID 4d10e9895679338a125dbb0855a39a63f41eb100 # Parent b8a2c9b9a2cb00507ebfc83418254c5b6ed7a1bd cleanup diff -r b8a2c9b9a2cb -r 4d10e9895679 server/sources/rql2sql.py --- a/server/sources/rql2sql.py Fri Sep 17 17:25:51 2010 +0200 +++ b/server/sources/rql2sql.py Fri Sep 17 17:25:58 2010 +0200 @@ -1141,11 +1141,11 @@ def visit_constant(self, constant): """generate SQL name for a constant""" - value = constant.value if constant.type is None: return 'NULL' + value = constant.value if constant.type == 'Int' and isinstance(constant.parent, SortTerm): - return constant.value + return value if constant.type in ('Date', 'Datetime'): rel = constant.relation() if rel is not None: @@ -1158,7 +1158,7 @@ # we may found constant from simplified var in varmap return self._mapped_term(constant, '%%(%s)s' % value)[0] except KeyError: - _id = constant.value + _id = value if isinstance(_id, unicode): _id = _id.encode() else: