From a93665a072fcb3f854c37789e4daa8e0ce06e152 Mon Sep 17 00:00:00 2001 From: helmutm Date: Thu, 21 Aug 2008 16:11:42 +0000 Subject: [PATCH] evaluate action condition on get git-svn-id: svn://svn.cy55.de/Zope3/src/cybertools/trunk@2834 fd906abe-77d9-0310-91a1-e0d9ade77398 --- browser/action.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/browser/action.py b/browser/action.py index ce4222d..c3618f6 100644 --- a/browser/action.py +++ b/browser/action.py @@ -110,6 +110,14 @@ class ActionRegistry(object): method = getattr(view, p, None) if method is not None: method() + condition = action.condition + if not isinstance(condition, bool): + if isinstance(condition, str): + condition = getattr(view, condition, None) + if callable(condition): + condition = condition() + if not condition: + continue yield action