(self, affect_attachments=False)
Removes this element from the model.
Removes this element from the model.
Removes this element from the model .
def remove(self, affect_attachments=False):
    """Removes this element from the model."""
    self._check_attachments_on_remove(affect_attachments)
    if affect_attachments:
      for attachment in self._attachments.values():
        attachment.remove(affect_attachments=True)
    for child in list(self._children):
      child.remove(affect_attachments)
    if self._spec.repeated or self._spec.on_demand:
      self._parent._children.remove(self)  # pylint: disable=protected-access
      for attribute in self._attributes.values():
        attribute._force_clear()  # pylint: disable=protected-access
      self._parent = None
      self._is_removed = True
    else:
      for attribute in self._attributes.values():
        attribute._force_clear()  # pylint: disable=protected-access
    self.namescope.increment_revision()
def remove ( self , affect_attachments = False ) : self . _check_attachments_on_remove ( affect_attachments ) if affect_attachments : for attachment in self . _attachments . values ( ) : attachment . remove ( affect_attachments = True ) for child in list ( self . _children ) : child . remove ( affect_attachments ) if self . _spec . repeated or self . _spec . on_demand : self . _parent . _children . remove ( self ) # pylint: disable=protected-access for attribute in self . _attributes . values ( ) : attribute . _force_clear ( ) # pylint: disable=protected-access self . _parent = None self . _is_removed = True else : for attribute in self . _attributes . values ( ) : attribute . _force_clear ( ) # pylint: disable=protected-access self . namescope . increment_revision ( )