From 564f07e3542d56739882c66e75243536fd0f8910 Mon Sep 17 00:00:00 2001 From: Massimo Date: Fri, 15 Feb 2013 10:51:30 -0600 Subject: [PATCH] IS_EXPR(lambda value: None(=) --- VERSION | 2 +- gluon/validators.py | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 4bc3af01..d27fe888 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -Version 2.4.1-alpha.2+timestamp.2013.02.14.17.33.32 +Version 2.4.1-alpha.2+timestamp.2013.02.15.10.50.49 diff --git a/gluon/validators.py b/gluon/validators.py index f5942167..7cdd0649 100644 --- a/gluon/validators.py +++ b/gluon/validators.py @@ -237,6 +237,9 @@ class IS_EXPR(Validator): self.environment = environment or {} def __call__(self, value): + if callable(self.expression): + return (value, self.expression(value)) + # for backward compatibility self.environment.update(value=value) exec '__ret__=' + self.expression in self.environment if self.environment['__ret__']: