IS_LIST_OF(other=[..])
This commit is contained in:
@@ -1 +1 @@
|
||||
Version 2.8.2-stable+timestamp.2014.01.08.11.31.12
|
||||
Version 2.8.2-stable+timestamp.2014.01.08.13.42.47
|
||||
|
||||
+9
-5
@@ -2462,14 +2462,18 @@ class IS_LIST_OF(Validator):
|
||||
if not self.maximum is None and len(ivalue) > self.maximum:
|
||||
return (ivalue, translate(self.error_message) % dict(min=self.minimum, max=self.maximum))
|
||||
new_value = []
|
||||
other = self.other
|
||||
if self.other:
|
||||
if not isinstance(other, (list,tuple)):
|
||||
other = [other]
|
||||
for item in ivalue:
|
||||
if item.strip():
|
||||
(v, e) = self.other(item)
|
||||
if e:
|
||||
return (ivalue, e)
|
||||
else:
|
||||
new_value.append(v)
|
||||
v = item
|
||||
for validator in other:
|
||||
(v, e) = validator(v)
|
||||
if e:
|
||||
return (ivalue, e)
|
||||
new_value.append(v)
|
||||
ivalue = new_value
|
||||
return (ivalue, None)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user