diff options
author | makkalot <makkalot@gmail.com> | 2008-06-21 16:47:00 +0300 |
---|---|---|
committer | makkalot <makkalot@gmail.com> | 2008-06-21 16:47:00 +0300 |
commit | 5c82990da0323d638b632152d1dc8ee338c16664 (patch) | |
tree | 3971d4a7274fdd0f9eabe7d4a793851749627395 /funcweb/funcweb/widget_validation.py | |
parent | 4706ba8c79bfae2feb48fc7fd8b9bb7770077ae4 (diff) | |
download | func-5c82990da0323d638b632152d1dc8ee338c16664.tar.gz func-5c82990da0323d638b632152d1dc8ee338c16664.tar.xz func-5c82990da0323d638b632152d1dc8ee338c16664.zip |
the final validator hash is done with its tests , happy testing :)
Diffstat (limited to 'funcweb/funcweb/widget_validation.py')
-rw-r--r-- | funcweb/funcweb/widget_validation.py | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/funcweb/funcweb/widget_validation.py b/funcweb/funcweb/widget_validation.py index 61d6254..ae1203e 100644 --- a/funcweb/funcweb/widget_validation.py +++ b/funcweb/funcweb/widget_validation.py @@ -129,7 +129,7 @@ class WidgetSchemaFactory(object): - def _add_list_validator(self,argument_name): + def _add_list_validator(self,argument_name,the_type='list'): """ Gets the options of the list type and adds a new validator to validator_list @@ -147,9 +147,16 @@ class WidgetSchemaFactory(object): list_data_set['regex_string'] = self.method_argument_dict[argument_name]['validator'] if list_data_set: - self.validator_list[argument_name]=MinionListValidator(**list_data_set) + if the_type == 'list': + self.validator_list[argument_name]=MinionListValidator(**list_data_set) + else: + self.validator_list[argument_name]=MinionHashValidator(**list_data_set) + else: - self.validator_list[argument_name]=MinionListValidator() + if the_type == 'list': + self.validator_list[argument_name]=MinionListValidator() + else: + self.validator_list[argument_name]=MinionHashValidator() @@ -158,7 +165,7 @@ class WidgetSchemaFactory(object): Gets the options of the hash type and adds a new validator to validator_list """ - pass + self._add_list_validator(argument_name,the_type = 'hash') def get_ready_schema(self): |