fixed issue 647, problem with is_in_db and multiple, thanks Manuele Presenti
This commit is contained in:
@@ -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
@@ -466,6 +466,7 @@ class IS_IN_DB(Validator):
|
|||||||
items.sort(options_sorter)
|
items.sort(options_sorter)
|
||||||
if zero and not self.zero is None and not self.multiple:
|
if zero and not self.zero is None and not self.multiple:
|
||||||
items.insert(0,('',self.zero))
|
items.insert(0,('',self.zero))
|
||||||
|
self.options() #
|
||||||
return items
|
return items
|
||||||
|
|
||||||
def __call__(self, value):
|
def __call__(self, value):
|
||||||
@@ -479,7 +480,7 @@ class IS_IN_DB(Validator):
|
|||||||
if isinstance(self.multiple,(tuple,list)) and \
|
if isinstance(self.multiple,(tuple,list)) and \
|
||||||
not self.multiple[0]<=len(values)<self.multiple[1]:
|
not self.multiple[0]<=len(values)<self.multiple[1]:
|
||||||
return (values, translate(self.error_message))
|
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)
|
return (values, None)
|
||||||
elif self.theset:
|
elif self.theset:
|
||||||
if str(value) in self.theset:
|
if str(value) in self.theset:
|
||||||
|
|||||||
Reference in New Issue
Block a user