From 323d1b83d6fb01932a0568c03d9386221e8d2c80 Mon Sep 17 00:00:00 2001 From: Emmanuel Garette Date: Fri, 29 Nov 2019 12:07:18 +0100 Subject: [PATCH] hack to make a dict without all none implemented feature --- tiramisu/todict.py | 36 +++++++++++++++++++----------------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/tiramisu/todict.py b/tiramisu/todict.py index 328b35e..265f09f 100644 --- a/tiramisu/todict.py +++ b/tiramisu/todict.py @@ -101,6 +101,7 @@ class Consistencies(object): self.tiramisu_web = tiramisu_web def add(self, path, childapi, form): + return if not childapi.option.isoptiondescription(): for consistency in childapi.option.consistencies(): cons_id, func, all_cons_opts, params = consistency @@ -157,6 +158,7 @@ class Requires(object): path, form, current_action): + return for requires in childapi.option.requires(): len_to_long = len(requires) > 1 for require in requires: @@ -472,8 +474,8 @@ class TiramisuDict: self.add_help(schema[path], childapi) except Exception as err: - # import traceback - # traceback.print_exc() + import traceback + traceback.print_exc() if not init: raise err error = err @@ -518,12 +520,12 @@ class TiramisuDict: schema[path]['autoFreeze'] = True if web_type == 'choice': - values, values_params = childapi.value.callbacks() - if values_params: - for values_param in chain(values_params.args, values_params.kwargs.values()): - if isinstance(values_param, ParamOption): - self.set_remotable(path, form, childapi) - return + #values, values_params = childapi.value.callbacks() + #if values_params: + # for values_param in chain(values_params.args, values_params.kwargs.values()): + # if isinstance(values_param, ParamOption): + # self.set_remotable(path, form, childapi) + # return schema[path]['enum'] = self.get_enum(childapi, is_multi, path, @@ -555,15 +557,15 @@ class TiramisuDict: if path in form: obj_form.update(form[path]) if not childapi_option.issymlinkoption(): - if childapi_option.validator() != (None, None): - obj_form['remote'] = True - params = childapi_option.validator()[1] - if params is not None: - for param in chain(params.args, params.kwargs.values()): - if isinstance(param, ParamContext): - raise ValueError(_('context is not supported from now for {}').format(path)) - if isinstance(param, ParamOption): - self.set_remotable(param.option.impl_getpath(), form) + #if childapi_option.validator() != (None, None): + # obj_form['remote'] = True + # params = childapi_option.validator()[1] + # if params is not None: + # for param in chain(params.args, params.kwargs.values()): + # if isinstance(param, ParamContext): + # raise ValueError(_('context is not supported from now for {}').format(path)) + # if isinstance(param, ParamOption): + # self.set_remotable(param.option.impl_getpath(), form) if self.clearable == 'all': obj_form['clearable'] = True if self.clearable != 'none':