code: def flags(self, index):
          Determines interaction allowed with table cells.
  
          See :qtdoc:`QAbstractItemModel<QAbstractItemModel.flags>`, 
          and :qtdoc:`subclassing<qabstractitemmodel.subclassing>`
          """
          if index.isValid():
              if self.model.editableRow(index.row()) and index.column() < 4:
                  return QtCore.Qt.ItemIsDragEnabled | \
                         QtCore.Qt.ItemIsEnabled | QtCore.Qt.ItemIsSelectable | \
                         QtCore.Qt.ItemIsEditable
              else:
                  return QtCore.Qt.ItemIsSelectable | QtCore.Qt.ItemIsEnabled
          else:
              print 'flags: index invalid'
docs: Determines interaction allowed with table cells.
  
          See :qtdoc:`QAbstractItemModel<QAbstractItemModel.flags>`, 
          and :qtdoc:`subclassing<qabstractitemmodel.subclassing>`