evaluate action condition on get
git-svn-id: svn://svn.cy55.de/Zope3/src/cybertools/trunk@2834 fd906abe-77d9-0310-91a1-e0d9ade77398
This commit is contained in:
parent
bb465adaf6
commit
a93665a072
1 changed files with 8 additions and 0 deletions
|
@ -110,6 +110,14 @@ class ActionRegistry(object):
|
||||||
method = getattr(view, p, None)
|
method = getattr(view, p, None)
|
||||||
if method is not None:
|
if method is not None:
|
||||||
method()
|
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
|
yield action
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue