hack to make a dict without all none implemented feature

This commit is contained in:
Emmanuel Garette 2019-11-29 12:07:18 +01:00
parent 709c0bf228
commit 323d1b83d6
1 changed files with 19 additions and 17 deletions

View File

@ -101,6 +101,7 @@ class Consistencies(object):
self.tiramisu_web = tiramisu_web self.tiramisu_web = tiramisu_web
def add(self, path, childapi, form): def add(self, path, childapi, form):
return
if not childapi.option.isoptiondescription(): if not childapi.option.isoptiondescription():
for consistency in childapi.option.consistencies(): for consistency in childapi.option.consistencies():
cons_id, func, all_cons_opts, params = consistency cons_id, func, all_cons_opts, params = consistency
@ -157,6 +158,7 @@ class Requires(object):
path, path,
form, form,
current_action): current_action):
return
for requires in childapi.option.requires(): for requires in childapi.option.requires():
len_to_long = len(requires) > 1 len_to_long = len(requires) > 1
for require in requires: for require in requires:
@ -472,8 +474,8 @@ class TiramisuDict:
self.add_help(schema[path], self.add_help(schema[path],
childapi) childapi)
except Exception as err: except Exception as err:
# import traceback import traceback
# traceback.print_exc() traceback.print_exc()
if not init: if not init:
raise err raise err
error = err error = err
@ -518,12 +520,12 @@ class TiramisuDict:
schema[path]['autoFreeze'] = True schema[path]['autoFreeze'] = True
if web_type == 'choice': if web_type == 'choice':
values, values_params = childapi.value.callbacks() #values, values_params = childapi.value.callbacks()
if values_params: #if values_params:
for values_param in chain(values_params.args, values_params.kwargs.values()): # for values_param in chain(values_params.args, values_params.kwargs.values()):
if isinstance(values_param, ParamOption): # if isinstance(values_param, ParamOption):
self.set_remotable(path, form, childapi) # self.set_remotable(path, form, childapi)
return # return
schema[path]['enum'] = self.get_enum(childapi, schema[path]['enum'] = self.get_enum(childapi,
is_multi, is_multi,
path, path,
@ -555,15 +557,15 @@ class TiramisuDict:
if path in form: if path in form:
obj_form.update(form[path]) obj_form.update(form[path])
if not childapi_option.issymlinkoption(): if not childapi_option.issymlinkoption():
if childapi_option.validator() != (None, None): #if childapi_option.validator() != (None, None):
obj_form['remote'] = True # obj_form['remote'] = True
params = childapi_option.validator()[1] # params = childapi_option.validator()[1]
if params is not None: # if params is not None:
for param in chain(params.args, params.kwargs.values()): # for param in chain(params.args, params.kwargs.values()):
if isinstance(param, ParamContext): # if isinstance(param, ParamContext):
raise ValueError(_('context is not supported from now for {}').format(path)) # raise ValueError(_('context is not supported from now for {}').format(path))
if isinstance(param, ParamOption): # if isinstance(param, ParamOption):
self.set_remotable(param.option.impl_getpath(), form) # self.set_remotable(param.option.impl_getpath(), form)
if self.clearable == 'all': if self.clearable == 'all':
obj_form['clearable'] = True obj_form['clearable'] = True
if self.clearable != 'none': if self.clearable != 'none':