Prevents cycles in the tree.

def clean(self):
        """ Prevents cycles in the tree. """
        super(CTENode, self).clean()
        if self.parent and self.pk in getattr(self.parent, self._cte_node_path):
            raise ValidationError(_("A node cannot be made a descendant of itself."))