summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormakkalot <makkalot@gmail.com>2008-06-18 22:35:45 +0300
committermakkalot <makkalot@gmail.com>2008-06-18 22:35:45 +0300
commitb97e94b8ba05612790f9f81e8906f9bf45b5a7fa (patch)
tree604f7e2b47bd52167b5c48163c5bdaa18c18f390
parentff6ca7c73e13bc0a28bef9a278c5f5449eb68732 (diff)
downloadfunc-b97e94b8ba05612790f9f81e8906f9bf45b5a7fa.tar.gz
func-b97e94b8ba05612790f9f81e8906f9bf45b5a7fa.tar.xz
func-b97e94b8ba05612790f9f81e8906f9bf45b5a7fa.zip
the initial work for validator part the structure will be like that
-rw-r--r--funcweb/funcweb/widget_validation.py74
1 files changed, 74 insertions, 0 deletions
diff --git a/funcweb/funcweb/widget_validation.py b/funcweb/funcweb/widget_validation.py
new file mode 100644
index 0000000..39bad1c
--- /dev/null
+++ b/funcweb/funcweb/widget_validation.py
@@ -0,0 +1,74 @@
+from turbogears import validators #the shiny validator part
+
+class WidgetSchemaFactory(object):
+ """
+ The purpose of the class is to produce a
+ validators.Schema object according to method
+ arguments that are retrieved from minions
+ """
+
+ def __init__(self,method_argument_dict):
+ """
+ @param method_argument_dict : The dict that is
+ from minion in format of {'arg':{'type':'string','options':[...]}}
+ the format is defined in func/minion/func_arg.py
+ """
+
+ self.method_argument_dict = method_argument_dict
+ self.validator_list = [] #the validator that will create final schema
+
+ def _add_validators(self):
+ """
+ Method is an entry point of factory iters over the all arguments
+ and according to their types it sends the process to more specialized
+ validator adders
+ """
+ pass
+
+ def _add_int_validator(self):
+ """
+ Gets the options of the int type and adds a
+ new validator to validator_list
+ """
+ pass
+
+ def _add_string_validator(self):
+ """
+ Gets the options of the string type and adds a
+ new validator to validator_list
+ """
+ pass
+
+ def _add_float_validator(self):
+ """
+ Gets the options of the float type and adds a
+ new validator to validator_list
+ """
+ pass
+
+ def _add_list_validator(self):
+ """
+ Gets the options of the list type and adds a
+ new validator to validator_list
+ """
+ pass
+
+ def _add_hash_validator(self):
+ """
+ Gets the options of the hash type and adds a
+ new validator to validator_list
+ """
+ pass
+
+
+ def get_ready_schema(self):
+ """
+ Get the final validator schema
+ """
+ pass
+
+
+
+
+if __name__ == "__main__":
+ pass