def get_next_sibling(self):
    opts = self._meta
    if self.is_root_node():
        filters = {
            '%s__isnull' % opts.parent_attr: True,
            '%s__gt' % opts.tree_id_attr: getattr(self, opts.tree_id_attr),
        }
    else:
        filters = {
             opts.parent_attr: getattr(self, '%s_id' % opts.parent_attr),
            '%s__gt' % opts.left_attr: getattr(self, opts.right_attr),
        }

    sibling = None
    try:
        sibling = self._tree_manager.filter(**filters)[0]
    except IndexError:
        pass
    return sibling
Called when the structure of a node has changed drastically.
dataset/ETHPy150Open agiliq/django-socialnews/socialnews/mptt/models.py/get_next_sibling--crossover with--dataset/ETHPy150Open enthought/pyface/pyface/tree/node_tree_model.py/NodeTreeModel._on_structure_changed