Fix expression evaluation with postgres

This commit is contained in:
ilvalle
2015-01-03 14:11:06 +01:00
parent 354e63d0fe
commit 3e1a918707
2 changed files with 5 additions and 3 deletions
+3 -2
View File
@@ -76,7 +76,8 @@ class BaseAdapter(ConnectionPool):
dbpath = None
folder = None
connector = lambda *args, **kwargs: None # __init__ should override this
TRUE_exp = '1'
FALSE_exp = '0'
TRUE = 'T'
FALSE = 'F'
T_SEP = ' '
@@ -909,7 +910,7 @@ class BaseAdapter(ConnectionPool):
return ','.join(self.represent(item,field_type) \
for item in expression)
elif isinstance(expression, bool):
return '1' if expression else '0'
return self.db._adapter.TRUE_exp if expression else self.db._adapter.FALSE_exp
else:
return str(expression)
+2 -1
View File
@@ -104,7 +104,8 @@ class PostgreSQLAdapter(BaseAdapter):
self.srid = srid
self.find_or_make_work_folder()
self._last_insert = None # for INSERT ... RETURNING ID
self.TRUE_exp = 'TRUE'
self.FALSE_exp = 'FALSE'
ruri = uri.split('://',1)[1]
m = self.REGEX_URI.match(ruri)
if not m: