Can someone help me with this:
I am trying to modify a wxGrid component after an update to a cell.
Here is the code:
(snip)
def GetValue(self, row, col):
return self.__rows[row][col]
def SetValue(self, row, col, valstr):
# Implement this when we want to modify data
stmt = "Update " + self.tableName + " set " +
self._colNames[col] + " = '" + valstr + "' where " + self._colNames[0] +
'=' + str(self.__rows[row][0])
#print stmt
#print 'update:', self.__rows[row][col],':',valstr
#Update the database!
x=self.__db.executeSQL(stmt)
#Update the grid
#xx=self.__SetValue(self, row, col, valstr)
self.__rows[row][col] = valstr
return True
(snip)
When I modify the cell's value it updates the Database correctly but I
get the following message:
.. line 54, in SetValue
self.__rows[row][col] = valstr
TypeError: object doesn't support item assignment