diff options
author | makkalot <makkalot@gmail.com> | 2008-06-21 20:23:40 +0300 |
---|---|---|
committer | makkalot <makkalot@gmail.com> | 2008-06-21 20:23:40 +0300 |
commit | 849bfc4b9ed176c6232fb4fd876bc441cc684a3f (patch) | |
tree | 3683b09c4856a3a1f98f49138ca8ceb8d3369b6d /funcweb | |
parent | 67a4dbd5886dc99c2e26c4b39ceb340654e1c2f4 (diff) | |
download | third_party-func-849bfc4b9ed176c6232fb4fd876bc441cc684a3f.tar.gz third_party-func-849bfc4b9ed176c6232fb4fd876bc441cc684a3f.tar.xz third_party-func-849bfc4b9ed176c6232fb4fd876bc441cc684a3f.zip |
add validator schema factory results to RemoteForm object
Diffstat (limited to 'funcweb')
-rw-r--r-- | funcweb/funcweb/tests/test_widget_automation.py | 7 | ||||
-rw-r--r-- | funcweb/funcweb/widget_automation.py | 3 |
2 files changed, 7 insertions, 3 deletions
diff --git a/funcweb/funcweb/tests/test_widget_automation.py b/funcweb/funcweb/tests/test_widget_automation.py index c82d40e..d02de93 100644 --- a/funcweb/funcweb/tests/test_widget_automation.py +++ b/funcweb/funcweb/tests/test_widget_automation.py @@ -3,6 +3,7 @@ import turbogears from turbogears import testutil from funcweb.widget_automation import WidgetListFactory,RemoteFormAutomation,RemoteFormFactory +from funcweb.widget_validation import WidgetSchemaFactory class TestWidgetListFactory(unittest.TestCase): @@ -48,8 +49,10 @@ class TestWidgetListFactory(unittest.TestCase): def test_remote_form(self): + schema_factory = WidgetSchemaFactory(self.get_test_default_args()) + schema_validator=schema_factory.get_ready_schema() widget_list_object = self.widget_factory.get_widgetlist_object() - remote_form = RemoteFormAutomation(widget_list_object) + remote_form = RemoteFormAutomation(widget_list_object,schema_validator) #print remote_form def test_remote_form_factory(self): @@ -71,7 +74,7 @@ class TestWidgetListFactory(unittest.TestCase): argument_name in all_fields - print remote_form.render() + #print remote_form.render() def get_test_default_args(self): return { diff --git a/funcweb/funcweb/widget_automation.py b/funcweb/funcweb/widget_automation.py index df521db..e6002e2 100644 --- a/funcweb/funcweb/widget_automation.py +++ b/funcweb/funcweb/widget_automation.py @@ -185,7 +185,7 @@ class RemoteFormAutomation(CoreWD): full_class_name = "funcweb.controllers.Root" - def __init__(self,generated_fields,*args,**kwarg): + def __init__(self,generated_fields,validator_schema,*args,**kwarg): """ The constructor part same as normal one except it takes a WidgetsList object into generated_fields @@ -195,6 +195,7 @@ class RemoteFormAutomation(CoreWD): super(RemoteFormAutomation,self).__init__(*args,**kwarg) self.for_widget = RemoteForm( fields = generated_fields, + validator = validator_schema, name = "minion_form", update = "col5", before='getElement(\'loading\').innerHTML=toHTML(IMG({src:\'../static/images/loading.gif\',width:\'80\',height:\'80\'}));', |