def __iadd__(self, other): o = other if self.__class__.is_domobj(o): o = (o, ) for item in flatten_list(o): if not self.__class__.is_domobj(item): raise ValueError(u'List contains items that are not a Dom obj!') # self._associate_domobj(o, self[-1] if len(self) > 0 else None, None) return MultiPurposeList.__iadd__(self, o)
def __iadd__(self, other): o = other if self.__class__.is_heading(o): o = (o, ) for item in flatten_list(o): if not self.__class__.is_heading(item): raise ValueError(u'List contains items that are not a heading!') self._associate_heading(o, self[-1] if len(self) > 0 else None, None) return MultiPurposeList.__iadd__(self, o)