Module: check_mk
Branch: master
Commit: 5857a9a5640e8ad05cc87f7339bbd2dd6670d43d
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=5857a9a5640e8a…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Fri Jun 1 07:42:17 2012 +0200
Allow choices of ListChoice to be a function
---
web/htdocs/valuespec.py | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/web/htdocs/valuespec.py b/web/htdocs/valuespec.py
index 3e71ef4..4394e70 100644
--- a/web/htdocs/valuespec.py
+++ b/web/htdocs/valuespec.py
@@ -972,7 +972,10 @@ class ListChoice(ValueSpec):
# In case of overloaded functions with dynamic elements
def load_elements(self):
if self._choices != None:
- self._elements = self._choices
+ if type(self._choices) == list:
+ self._elements = self._choices
+ else:
+ self._elements = self._choices()
return
if self._loaded_at != id(html):