From 41924054440809501a3b63576c3b4704d6eb1212 Mon Sep 17 00:00:00 2001 From: mdipierro Date: Wed, 8 Jan 2014 13:43:49 -0600 Subject: [PATCH] IS_LIST_OF(other=[..]) --- VERSION | 2 +- gluon/validators.py | 14 +++++++++----- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/VERSION b/VERSION index fd524df8..19af10b9 100644 --- a/VERSION +++ b/VERSION @@ -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 diff --git a/gluon/validators.py b/gluon/validators.py index 436e96c0..c9a20e33 100644 --- a/gluon/validators.py +++ b/gluon/validators.py @@ -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)