Probably I need to use Python Class and init??
My Python powers cannot make it. Need help.
For the life of me, cannot figure this out.
Step 1: I copied column Object to columnObject Variable:
columnObject = {
"field": "",
"visible": True,
"editable": False,
"render": "auto",
"justify": "auto",
"align": "center",
"resizable": True,
"sortable": True,
"sort": "none",
"filter": {
"enabled": False,
"visible": "on-hover",
"string": {
"condition": "",
"value": ""
},
"number": {
"condition": "",
"value": ""
},
"boolean": {
"condition": ""
},
"date": {
"condition": "",
"value": ""
}
},
"viewPath": "",
"viewParams": {},
"boolean": "checkbox",
"number": "value",
"progressBar": {
"max": 100,
"min": 0,
"bar": {
"color": "",
"style": {
"classes": ""
}
},
"track": {
"color": "",
"style": {
"classes": ""
}
},
"value": {
"enabled": True,
"format": "0,0.##",
"justify": "center",
"style": {
"classes": ""
}
}
},
"toggleSwitch": {
"color": {
"selected": "",
"unselected": ""
}
},
"numberFormat": "0,0.##",
"dateFormat": "MM/DD/YYYY",
"width": "",
"strictWidth": False,
"style": {
"classes": ""
},
"header": {
"title": "",
"justify": "left",
"align": "center",
"style": {
"classes": ""
}
},
"footer": {
"title": "",
"justify": "left",
"align": "center",
"style": {
"classes": ""
}
}
}
step 2: Create empty list
columnList = []
step 3: using for loop, append columnObject to columnList and edit "field" member
for colName in ds.getColumnNames():
colObject = {}
colObject = columnObject
colObject['field'] = colName
columnList.append(colObject)
For the life of me.. can't make it work..
The resulting list will have same name on "Field".