code: def setData(self, index, value, role):
          
          if role == QtCore.Qt.EditRole:
              if isinstance(value, QtCore.QVariant):
                  value = value.toPyObject()
              if index.column() == 0:
                  test = self._testmodel.test(index.row())
                  test.setUserTag(str(value))
                  return True
              if index.column() == 2:
                  test = self._testmodel.test(index.row())
                  test.setRepCount(value)
                  return True
          return False
docs: Sets data at *index* to *value* in underlying data structure
  
          See :qtdoc:`QAbstractItemModel<QAbstractItemModel.setData>`, 
          and :qtdoc:`subclassing<qabstractitemmodel.subclassing>`