I would like to store the information about whether a checkbox is checked or not in a boolean column in my database (running on PostGreSQL 9.3). I'm using a custom form, and the corresponding checkbox field should appear as checked or unchecked depending on its value in the database - and the value in the database should update if the user changes the state of the checkbox.
I created a variable for the checkbox in my Python script:
global zone_humide zone_humide = dialog.findChild(QCheckBox, "zone_humide")
I also made sure that the field has the same name as its corresponding column in the database. But when I check or uncheck the box, the change is not recorded in the database - and consequently, I can't call back the current state of the box when I open my form again.