* fixed bad indentation

* _is_operator return value is clearer

bzr revid: olt@tinyerp.com-20090121131725-lz105wcnjfcz6b3g
This commit is contained in:
Olivier Laurent 2009-01-21 14:17:25 +01:00
parent 0b7023326a
commit cad89b87ec
1 changed files with 2 additions and 3 deletions

View File

@ -34,8 +34,7 @@ class expression(object):
"""
def _is_operator(self, element):
return (isinstance(element, str) or isinstance(element, unicode)) \
and element in ['&', '|', '!']
return isinstance(element, (str, unicode)) and element in ['&', '|', '!']
def _is_leaf(self, element, internal=False):
OPS = ('=', '!=', '<>', '<=', '<', '>', '>=', '=like', 'like', 'not like', 'ilike', 'not ilike', 'in', 'not in', 'child_of')
@ -246,7 +245,7 @@ class expression(object):
if len_after:
if left == 'id':
instr = ','.join(['%s'] * len_after)
instr = ','.join(['%s'] * len_after)
else:
instr = ','.join([table._columns[left]._symbol_set[0]] * len_after)
query = '(%s.%s %s (%s))' % (table._table, left, operator, instr)