diff options
author | makkalot <makkalot@gmail.com> | 2008-06-12 19:42:43 +0300 |
---|---|---|
committer | makkalot <makkalot@gmail.com> | 2008-06-12 19:42:43 +0300 |
commit | 588679c610f0f93f40fd2bfa9c6ce01a6223e778 (patch) | |
tree | 3f1d60440cb33c1a308e53d39b38103fedd71209 /funcweb/funcweb/widget_automation.py | |
parent | e21ab672adc4076ef3e9068db5420787802556b4 (diff) | |
download | func-588679c610f0f93f40fd2bfa9c6ce01a6223e778.tar.gz func-588679c610f0f93f40fd2bfa9c6ce01a6223e778.tar.xz func-588679c610f0f93f40fd2bfa9c6ce01a6223e778.zip |
returning back a WidgetList object
Diffstat (limited to 'funcweb/funcweb/widget_automation.py')
-rw-r--r-- | funcweb/funcweb/widget_automation.py | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/funcweb/funcweb/widget_automation.py b/funcweb/funcweb/widget_automation.py index 4d6d665..36d8a5c 100644 --- a/funcweb/funcweb/widget_automation.py +++ b/funcweb/funcweb/widget_automation.py @@ -121,8 +121,25 @@ class WidgetListFactory(object): def get_widgetlist(self): """ - Return the final list back + Return back a dictionay with argument_name : input_widget + pairs. That method may not be called directly,get_widgetlist_object + is better for using in web interface """ #compute the list self.__add_general_widget() return self.__widget_list + + def get_widgetlist_object(self): + """ + Method return back the final widgetlist object + which is turbogears.widgets.WidgetsList + """ + if len(self.__widget_list.keys())==0: + self.__add_general_widget() #not very efficient + + widget_list_object = widgets.WidgetsList() + for name,input_widget in self.__widget_list.iteritems(): + setattr(widget_list_object,name,input_widget) + + #get the object back + return widget_list_object |