fixed issue 1147, belongs(None), thanks Marin

This commit is contained in:
mdipierro
2012-11-06 14:26:28 -06:00
parent 3f266a188a
commit fc739f242d
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -1 +1 @@
Version 2.2.1 (2012-11-06 10:36:39) stable
Version 2.2.1 (2012-11-06 14:26:21) stable
+1 -1
View File
@@ -1199,7 +1199,7 @@ class BaseAdapter(ConnectionPool):
def BELONGS(self, first, second):
if isinstance(second, str):
return '(%s IN (%s))' % (self.expand(first), second[:-1])
elif second==[] or second==():
elif not second:
return '(1=0)'
items = ','.join(self.expand(item, first.type) for item in second)
return '(%s IN (%s))' % (self.expand(first), items)