fixed issue 647, problem with is_in_db and multiple, thanks Manuele Presenti

This commit is contained in:
Massimo Di Pierro
2012-02-11 23:06:24 -06:00
parent d1e654ee23
commit cda213f38c
2 changed files with 3 additions and 2 deletions
+1 -1
View File
@@ -1 +1 @@
Version 1.99.4 (2012-02-09 11:21:10) stable
Version 1.99.4 (2012-02-11 23:04:52) stable
+2 -1
View File
@@ -466,6 +466,7 @@ class IS_IN_DB(Validator):
items.sort(options_sorter)
if zero and not self.zero is None and not self.multiple:
items.insert(0,('',self.zero))
self.options() #
return items
def __call__(self, value):
@@ -479,7 +480,7 @@ class IS_IN_DB(Validator):
if isinstance(self.multiple,(tuple,list)) and \
not self.multiple[0]<=len(values)<self.multiple[1]:
return (values, translate(self.error_message))
if not [x for x in values if not x in self.theset]:
if not [x for x in values if not str(x) in self.theset]:
return (values, None)
elif self.theset:
if str(value) in self.theset: