support not_equal for tiramisu-web
This commit is contained in:
parent
5bf75b3824
commit
8bd1b27f73
|
@ -723,7 +723,7 @@ class Option(OnlyOption):
|
||||||
"accesses the Option's doc"
|
"accesses the Option's doc"
|
||||||
return self.impl_get_information('doc')
|
return self.impl_get_information('doc')
|
||||||
|
|
||||||
def _valid_consistencies(self, other_opts, init=True):
|
def _valid_consistencies(self, other_opts, init=True, func=None):
|
||||||
if self._is_subdyn():
|
if self._is_subdyn():
|
||||||
dynod = self._impl_getsubdyn()
|
dynod = self._impl_getsubdyn()
|
||||||
else:
|
else:
|
||||||
|
@ -753,8 +753,9 @@ class Option(OnlyOption):
|
||||||
raise ConfigError(_('every options in consistency must be '
|
raise ConfigError(_('every options in consistency must be '
|
||||||
'multi or none'))
|
'multi or none'))
|
||||||
if init:
|
if init:
|
||||||
#consistency could generate warnings or errors
|
# FIXME
|
||||||
opt._set_has_dependency()
|
if func != 'not_equal':
|
||||||
|
opt._set_has_dependency()
|
||||||
|
|
||||||
def impl_add_consistency(self, func, *other_opts, **params):
|
def impl_add_consistency(self, func, *other_opts, **params):
|
||||||
"""Add consistency means that value will be validate with other_opts
|
"""Add consistency means that value will be validate with other_opts
|
||||||
|
@ -771,7 +772,7 @@ class Option(OnlyOption):
|
||||||
" read-only").format(
|
" read-only").format(
|
||||||
self.__class__.__name__,
|
self.__class__.__name__,
|
||||||
self.impl_getname()))
|
self.impl_getname()))
|
||||||
self._valid_consistencies(other_opts)
|
self._valid_consistencies(other_opts, func=func)
|
||||||
func = '_cons_{0}'.format(func)
|
func = '_cons_{0}'.format(func)
|
||||||
if func not in dir(self):
|
if func not in dir(self):
|
||||||
raise ConfigError(_('consistency {0} not available for this option').format(func))
|
raise ConfigError(_('consistency {0} not available for this option').format(func))
|
||||||
|
@ -789,8 +790,9 @@ class Option(OnlyOption):
|
||||||
for opt in all_cons_opts:
|
for opt in all_cons_opts:
|
||||||
if getattr(opt, '_unique', undefined) == undefined:
|
if getattr(opt, '_unique', undefined) == undefined:
|
||||||
opt._unique = True
|
opt._unique = True
|
||||||
#consistency could generate warnings or errors
|
if func != '_cons_not_equal':
|
||||||
self._set_has_dependency()
|
#consistency could generate warnings or errors
|
||||||
|
self._set_has_dependency()
|
||||||
|
|
||||||
def _valid_consistency(self, option, value, context, index, submulti_idx,
|
def _valid_consistency(self, option, value, context, index, submulti_idx,
|
||||||
display_warnings, display_error):
|
display_warnings, display_error):
|
||||||
|
|
Loading…
Reference in New Issue