Fix "in" and "not in" clause for boolean

This commit is contained in:
Cédric Krier committed 2009-05-13 19:16:48 +02:00
1 parent 676c09aedc
commit 10b144be4e
1 file changed
+5 -4
+5 -4
View File
@@ -1583,10 +1583,11 @@ class ModelSQL(ModelStorage):
elif arg[1] in ('in', 'not in'):
if len(arg[2]) > 0:
todel = []
for xitem in range(len(arg[2])):
if arg[2][xitem] == False \
and isinstance(arg[2][xitem],bool):
todel.append(xitem)
if table._columns[arg[0]]._type != 'boolean':
for xitem in range(len(arg[2])):
if arg[2][xitem] == False \
and isinstance(arg[2][xitem],bool):
todel.append(xitem)
arg2 = arg[2][:]
for xitem in todel[::-1]:
del arg2[xitem]