def METHOD_NAME(self):
    # Takes the selection on the view's side and update the model with it.
    # an _updateViewSelection() call will normally result in an _updateModelSelection() call.
    # to avoid infinite loops, we check that the selection will actually change before calling
    # model.select()
    new_indexes = [modelIndex.row() for modelIndex in self.view.selectionModel().selectedRows()]
    if new_indexes != self.model.selected_indexes:
        self.model.select(new_indexes)