better sqlalchemy integration
This commit is contained in:
@ -24,7 +24,7 @@ import re
|
||||
|
||||
from ..i18n import _
|
||||
from ..setting import groups, undefined, owners # , log
|
||||
from .baseoption import BaseOption, SymLinkOption
|
||||
from .baseoption import BaseOption, SymLinkOption, Option
|
||||
from . import MasterSlaves
|
||||
from ..error import ConfigError, ConflictError
|
||||
from ..storage import get_storages_option
|
||||
@ -229,7 +229,20 @@ class OptionDescription(BaseOption, StorageOptionDescription):
|
||||
if isinstance(group_type, groups.GroupType):
|
||||
self._group_type = group_type
|
||||
if isinstance(group_type, groups.MasterGroupType):
|
||||
MasterSlaves(self.impl_getname(), self.impl_getchildren())
|
||||
children = self.impl_getchildren()
|
||||
for child in children:
|
||||
if isinstance(child, SymLinkOption): # pragma: optional cover
|
||||
raise ValueError(_("master group {0} shall not have "
|
||||
"a symlinkoption").format(self.impl_getname()))
|
||||
if not isinstance(child, Option): # pragma: optional cover
|
||||
raise ValueError(_("master group {0} shall not have "
|
||||
"a subgroup").format(self.impl_getname()))
|
||||
if not child.impl_is_multi(): # pragma: optional cover
|
||||
raise ValueError(_("not allowed option {0} "
|
||||
"in group {1}"
|
||||
": this option is not a multi"
|
||||
"").format(child.impl_getname(), self.impl_getname()))
|
||||
MasterSlaves(self.impl_getname(), children)
|
||||
else: # pragma: optional cover
|
||||
raise ValueError(_('group_type: {0}'
|
||||
' not allowed').format(group_type))
|
||||
@ -365,7 +378,6 @@ class DynOptionDescription(OptionDescription):
|
||||
'dynoptiondescription'))
|
||||
child._impl_setsubdyn(self)
|
||||
self.impl_set_callback(callback, callback_params)
|
||||
self.commit()
|
||||
|
||||
def _validate_callback(self, callback, callback_params):
|
||||
if callback is None:
|
||||
|
Reference in New Issue
Block a user