code: def sort(self, column, order=Qt.AscendingOrder):
          
  
          if column > self.columnCount():
              return
  
          self.beginResetModel()
          if column == 0:
              self.__root_node.sort_children(reverse_order=order)
          else:
              self.__root_node.sort_children(
                  attribute=self.__horizontal_headers[self.__horizontal_headers.keys()[column]],
                  reverse_order=order)
          self.endResetModel()
docs: Reimplements the :meth:`QAbstractItemModel.sort` method.
  
          :param column: Column.
          :type column: int
          :param order: Order. ( Qt.SortOrder )