From 4b367a5d5759c7c2b2307ffb195172d8b87f5e74 Mon Sep 17 00:00:00 2001 From: makkalot Date: Mon, 16 Jun 2008 00:50:32 +0300 Subject: adding the minion,module,method as hidden fields --- funcweb/funcweb/widget_automation.py | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/funcweb/funcweb/widget_automation.py b/funcweb/funcweb/widget_automation.py index 68b4108..412da34 100644 --- a/funcweb/funcweb/widget_automation.py +++ b/funcweb/funcweb/widget_automation.py @@ -32,7 +32,7 @@ class WidgetListFactory(object): } #will contain the input widget created in that class - def __init__(self,argument_dict): + def __init__(self,argument_dict,minion=None,module=None,method=None): """ Initiated with argument_dict of a method to return back a WidgetsList object to be placed into a form object @@ -43,6 +43,11 @@ class WidgetListFactory(object): self.__argument_dict = argument_dict self.__widget_list={} + + #these fields will be passed ass hidden so we need them + self.minion = minion + self.module = module + self.method = method def __add_general_widget(self): @@ -76,6 +81,16 @@ class WidgetListFactory(object): #print "That have the object :",getattr(self.__widget_list["list_default"],"default") + #adding the hidden fields (that part wass adde later can be made more generic) + if self.minion: + self.__widget_list['minion']= getattr(widgets,'HiddenField')(name="minion",value=self.minion,default=self.minion) + if self.module: + self.__widget_list['module']= getattr(widgets,'HiddenField')(name="module",value=self.module,default=self.module) + if self.method: + self.__widget_list['method']= getattr(widgets,'HiddenField')(name="method",value=self.method,default=self.method) + + + def __add_specialized_string(self,argument,argument_name): """ Specialized option adder, called when the type:string is used -- cgit