summaryrefslogtreecommitdiffstats
path: root/funcweb
diff options
context:
space:
mode:
authormakkalot <makkalot@gmail.com>2008-08-11 23:18:16 +0300
committermakkalot <makkalot@gmail.com>2008-08-11 23:18:16 +0300
commitf0c042888db84e241d63cf33683644ab83b65437 (patch)
tree988af28b6559e1aa9fa4ab16a192dc57abff7fb2 /funcweb
parent7e83f3d857bbb43817d703607b25aa6ea1c6d5a6 (diff)
downloadfunc-f0c042888db84e241d63cf33683644ab83b65437.tar.gz
func-f0c042888db84e241d63cf33683644ab83b65437.tar.xz
func-f0c042888db84e241d63cf33683644ab83b65437.zip
the small patch for adding the list*
Diffstat (limited to 'funcweb')
-rw-r--r--funcweb/funcweb/widget_automation.py10
-rw-r--r--funcweb/funcweb/widget_validation.py9
2 files changed, 15 insertions, 4 deletions
diff --git a/funcweb/funcweb/widget_automation.py b/funcweb/funcweb/widget_automation.py
index 9467f21..9769586 100644
--- a/funcweb/funcweb/widget_automation.py
+++ b/funcweb/funcweb/widget_automation.py
@@ -28,6 +28,8 @@ class WidgetListFactory(object):
'hash':{
'type':"RepeatingFieldSet"},
'list':{
+ 'type':"RepeatingFieldSet"},
+ 'list*':{
'type':"RepeatingFieldSet"}
}
#will contain the input widget created in that class
@@ -50,7 +52,8 @@ class WidgetListFactory(object):
self.method = method
def __add_general_widget(self):
-
+ # a mirror var to show that these are same things
+ mirror_case = {'list*':'list'}
#key is the argument_name and the argument are options
for key,argument in self.__argument_dict.iteritems():
#get the type of the argument
@@ -69,7 +72,10 @@ class WidgetListFactory(object):
if act_special:
#calling for example __add_specialized_string(..)
- getattr(self,"_%s__add_specialized_%s"%(self.__class__.__name__,current_type))(argument,key)
+ if current_type == "list*":
+ getattr(self,"_%s__add_specialized_%s"%(self.__class__.__name__,mirror_case[current_type]))(argument,key)
+ else:
+ getattr(self,"_%s__add_specialized_%s"%(self.__class__.__name__,current_type))(argument,key)
else:
temp_object = getattr(widgets,self.__convert_table[current_type]['default_value'])()
#add common options to it
diff --git a/funcweb/funcweb/widget_validation.py b/funcweb/funcweb/widget_validation.py
index 9b67e7f..b04572a 100644
--- a/funcweb/funcweb/widget_validation.py
+++ b/funcweb/funcweb/widget_validation.py
@@ -23,11 +23,16 @@ class WidgetSchemaFactory(object):
and according to their types it sends the process to more specialized
validator adders
"""
-
+ # a mirror var to show that these are same things
+ mirror_case = {'list*':'list'}
for argument_name,argument_values in self.method_argument_dict.iteritems():
#some lazy stuff :)
#for ex : _add_int_validator(some_arg)
- getattr(self,"_add_%s_validator"%(argument_values['type']))(argument_name)
+ current_type = argument_values['type']
+ if current_type == "list*":
+ getattr(self,"_add_%s_validator"%(mirror_case[current_type]))(argument_name)
+ else:
+ getattr(self,"_add_%s_validator"%(current_type))(argument_name)
def _add_boolean_validator(self,argument_name):
bool_data_set = {}