code: def get_ancestors(self):
          
          ancestors = []
          if self._meta.proxy_for_model:
              # the current node is a proxy model; our result set
              # should use the same proxy model, so we need to
              # explicitly fetch instances of that model
              # when following the 'parent' relation
              cls = self.__class__
              node = self
              while node.parent_id:
                  node = cls.objects.get(pk=node.parent_id)
                  ancestors.insert(0, node)
          else:
              node = self.parent
              while node:
                  ancestors.insert(0, node)
                  node = node.parent
          return ancestors
docs: :returns: A *list* containing the current node object's ancestors,
              starting by the root node and descending to the parent.