Jan-18-2023, 07:05 PM
does not work with load, it says
Now I have another question, I have some entries to be able to modify the data obtained from the treeview. These work and when I modify them in the tree they are updated, but how would I call the json in this situation to update the values and not to add them as another object in the list?
with this I select the object in the tree
Error:AttributeError: 'str' object has no attribute 'read'
with loads it shows me the json data in the treeview.Now I have another question, I have some entries to be able to modify the data obtained from the treeview. These work and when I modify them in the tree they are updated, but how would I call the json in this situation to update the values and not to add them as another object in the list?
with this I select the object in the tree
def select_record(): logo_lb.delete(0,END) nombre_lb.delete(0,END) tenantid_lb.delete(0,END) aplicationid_lb.delete(0,END) secretid_lb.delete(0,END) token_lb.delete(0,END) periodicidad_lb.delete(0,END) region_combobox2.delete(0,END) selected = json_tree.focus() e values = json_tree.item(selected,'values') logo_lb.insert(0, values[0]) nombre_lb.insert(0,values[1]) tenantid_lb.insert(0,values[2]) aplicationid_lb.insert(0,values[3]) secretid_lb.insert(0,values[4]) token_lb.insert(0,values[5]) periodicidad_lb.insert(0,values[6]) region_combobox2.insert(0,values[7])with this I save the updates, which are only visualized in the tree but as it is not connected with the json, the changes are not made in the file.
def update_record(): selected = json_tree.focus() json_tree.item(selected, text='', values=(logo_lb.get(),nombre_lb.get(),tenantid_lb.get(),aplicationid_lb.get(),secretid_lb.get(),token_lb.get(),periodicidad_lb.get(),region_combobox2.get())) logo_lb.delete(0,END) nombre_lb.delete(0,END) tenantid_lb.delete(0,END) aplicationid_lb.delete(0,END) secretid_lb.delete(0,END) token_lb.delete(0,END) periodicidad_lb.delete(0,END) region_combobox2.delete(0,END)