Add "force_store_value" property. If set, store, for example, calculated value as owner values.
So calculated value are calculate only one time.
This commit is contained in:
parent
1f0bb88bc1
commit
447c175b6a
|
@ -146,6 +146,9 @@ class Values(object):
|
|||
if validate and not opt.validate(value, self.context, setting.has_property('validator')):
|
||||
raise ValueError(_('invalid calculated value returned'
|
||||
' for option {0}: {1}').format(opt._name, value))
|
||||
if self.is_default_owner(opt) and \
|
||||
setting.has_property('auto_store_value', opt, False):
|
||||
self.setitem(opt, value)
|
||||
return value
|
||||
|
||||
def __setitem__(self, opt, value):
|
||||
|
|
Loading…
Reference in New Issue