code: def add_root(cls, **kwargs):
          
  
          if len(kwargs) == 1 and 'instance' in kwargs:
              # adding the passed (unsaved) instance to the tree
              newobj = kwargs['instance']
              if newobj.pk:
                  raise NodeAlreadySaved("Attempted to add a tree node that is "\
                      "already in the database")
          else:
              newobj = cls(**kwargs)
  
          newobj._cached_depth = 1
          if not cls.node_order_by:
              try:
                  max = get_result_class(cls).objects.filter(
                      parent__isnull=True).order_by(
                      'sib_order').reverse()[0].sib_order
              except IndexError:
                  max = 0
              newobj.sib_order = max + 1
          newobj.save()
          return newobj
docs: Adds a root node to the tree.