Fix expression evaluation with postgres
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user