Module: check_mk
Branch: master
Commit: d7c91cc17c35188f4c7b6be5ed94d9270321cb23
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=d7c91cc17c3518…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Wed Oct 8 09:59:15 2014 +0200
Dictionary: allow form rendering when calling render_input
---
web/htdocs/valuespec.py | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/web/htdocs/valuespec.py b/web/htdocs/valuespec.py
index 95eea18..1555a1f 100644
--- a/web/htdocs/valuespec.py
+++ b/web/htdocs/valuespec.py
@@ -2588,11 +2588,15 @@ class Dictionary(ValueSpec):
else:
return []
- def render_input(self, varprefix, value):
+ # Additional variale form allows to specify the rendering
+ # style right now
+ def render_input(self, varprefix, value, form=None):
value = self.migrate(value)
if type(value) != dict:
value = {} # makes code simpler in complain phase
- if self._render == "form":
+ if form == True:
+ self.render_input_form(varprefix, value)
+ elif self._render == "form" and form == None:
self.render_input_form(varprefix, value)
else:
self.render_input_normal(varprefix, value, self._render ==
"oneline")