Perspective table cell color

it might be easier to use “getColumnNames()” instead of “getColumnCount()”, so you dont have to worry about sorting indexes

this:

for col in value.getColumnNames():
....
if col == 'LED':
...
row_object[col]=cell_object

instead of:

for col in range(value.getColumnCount()):
...
value.getColumnName(col) == 'LED'
...
row_object[value.getColumnName(col)]=cell_object
2 Likes