I have a power table
if colName=='DefectType':
query="select Code,Name from RubberDefect"
DefectType=system.db.runQuery(query,'MaluProduction')
return {'options': [(row[0], row[1]) for row in DefectType]}
In my database I have two column

I current can use the upside logic show the Chinese word in the dropdown list.
when I selected, the English word will exists

Now I want to drop down list according to another column data

if colName=='DefectType':
root = self
if root.data.getValueAt(row, 'Cmode')== 'R':
#while the ColName=Cmode and value =R, use the query
query="select Code,Name from RubberDefect"
DefectType=system.db.runQuery(query,'MaluProduction')
return {'options':[(row[0], row[1]) for row in DefectType]}
else:
query2="select Code,Name from RubberDefectB"
#while the ColName=Cmode and value <>R, use the query2
DefectType=system.db.runQuery(query2,'MaluProduction')
return {'options':[(row[0], row[1]) for row in DefectType]}
I have tried code, but not success, can you help to modify the code?

