getdefault returns the default_multi
This commit is contained in:
parent
de47772958
commit
1dea71c17f
|
@ -190,9 +190,12 @@ class Option(HiddenBaseType, DisabledBaseType):
|
||||||
return False
|
return False
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def getdefault(self):
|
def getdefault(self, default_multi=False):
|
||||||
"accessing the default value"
|
"accessing the default value"
|
||||||
return self.default
|
if default_multi == False or not self.is_multi():
|
||||||
|
return self.default
|
||||||
|
else:
|
||||||
|
return self.getdefault_multi()
|
||||||
|
|
||||||
def getdefault_multi(self):
|
def getdefault_multi(self):
|
||||||
"accessing the default value for a multi"
|
"accessing the default value for a multi"
|
||||||
|
@ -326,11 +329,6 @@ class ChoiceOption(Option):
|
||||||
requires=None, mandatory=False, multi=False, callback=None,
|
requires=None, mandatory=False, multi=False, callback=None,
|
||||||
callback_params=None, open_values=False, validator=None,
|
callback_params=None, open_values=False, validator=None,
|
||||||
validator_args={}):
|
validator_args={}):
|
||||||
"""
|
|
||||||
:default: default non multi option's value
|
|
||||||
:default_multi: default value in case of a multi
|
|
||||||
:param open_values: allowed values for the option's value
|
|
||||||
"""
|
|
||||||
self.values = values
|
self.values = values
|
||||||
if open_values not in [True, False]:
|
if open_values not in [True, False]:
|
||||||
raise ConfigError('Open_values must be a boolean for '
|
raise ConfigError('Open_values must be a boolean for '
|
||||||
|
|
Loading…
Reference in New Issue