equal
deleted
inserted
replaced
47 .. _Comparison of different SQL implementations: http://www.troels.arvin.dk/db/rdbms |
47 .. _Comparison of different SQL implementations: http://www.troels.arvin.dk/db/rdbms |
48 """ |
48 """ |
49 |
49 |
50 import threading |
50 import threading |
51 |
51 |
52 from six import PY2 |
52 from six import PY2, text_type |
53 from six.moves import range |
53 from six.moves import range |
54 |
54 |
55 from logilab.database import FunctionDescr, SQL_FUNCTIONS_REGISTRY |
55 from logilab.database import FunctionDescr, SQL_FUNCTIONS_REGISTRY |
56 |
56 |
57 from rql import BadRQLQuery, CoercionError |
57 from rql import BadRQLQuery, CoercionError |
1509 if rel is not None: |
1509 if rel is not None: |
1510 rel._q_needcast = value |
1510 rel._q_needcast = value |
1511 return self.keyword_map[value]() |
1511 return self.keyword_map[value]() |
1512 if constant.type == 'Substitute': |
1512 if constant.type == 'Substitute': |
1513 _id = value |
1513 _id = value |
1514 if PY2 and isinstance(_id, unicode): |
1514 if PY2 and isinstance(_id, text_type): |
1515 _id = _id.encode() |
1515 _id = _id.encode() |
1516 else: |
1516 else: |
1517 _id = str(id(constant)).replace('-', '', 1) |
1517 _id = str(id(constant)).replace('-', '', 1) |
1518 self._query_attrs[_id] = value |
1518 self._query_attrs[_id] = value |
1519 return '%%(%s)s' % _id |
1519 return '%%(%s)s' % _id |