improve performance
This commit is contained in:
@ -132,16 +132,17 @@ class OptionDescription(BaseOption, StorageOptionDescription):
|
||||
for option in self._impl_getchildren(dyn=False):
|
||||
#FIXME specifique id for sqlalchemy?
|
||||
#FIXME avec sqlalchemy ca marche le multi parent ? (dans des configs différentes)
|
||||
#if option.id is None:
|
||||
# raise SystemError(_("an option's id should not be None "
|
||||
# "for {0}").format(option.impl_getname()))
|
||||
if option._get_id() in cache_option: # pragma: optional cover
|
||||
raise ConflictError(_('duplicate option: {0}').format(option))
|
||||
cache_option.append(option._get_id())
|
||||
oid = option._get_id()
|
||||
cache_option.append(oid)
|
||||
option._set_readonly()
|
||||
if isinstance(option, OptionDescription):
|
||||
option.impl_validate_options(cache_option)
|
||||
if init:
|
||||
if len(cache_option) != len(set(cache_option)):
|
||||
for idx in xrange(1, len(cache_option)+1):
|
||||
opt = cache_option.pop(0)
|
||||
if opt in cache_option:
|
||||
raise ConflictError(_('duplicate option: {0}').format(opt))
|
||||
self._set_readonly()
|
||||
|
||||
# ____________________________________________________________
|
||||
|
Reference in New Issue
Block a user