code: def get_queryset(self, *args, **kwargs):
          
          qs = super(TreeManager, self).get_queryset(*args, **kwargs)
  
          # Restrict operations to pages on the current site if needed
          if settings.PAGES_HIDE_SITES and settings.PAGES_USE_SITE_ID:
              return qs.order_by(self.tree_id_attr, self.left_attr).filter(sites=settings.SITE_ID)
          else:
              return qs.order_by(self.tree_id_attr, self.left_attr)
docs: Ensures that this manager always returns nodes in tree order.