How can i create a if statement to get data from a tkinter treeview?

Viewed 47

I need an If statement that gets data from column 1 only if the id_cad entry is empty on the form. If id_cad is not empty I need to get only the others. How can I do that?

I tried to do that:

def ondoubleclick3(self, event):
  self.limpa_dados3()
  self.list_agd_cad.selection()
     if self.id_entry.get() == "":
       for n in self.list_agd_cad.selection():
       col1, col2, col3, col4 = self.list_agd_cad.item(n, 'values')
       self.id_cad_entry.insert(END, col1)
       self.dia_semana_entry.insert(END, col2)
       self.dta_agenda_pessoa_entry.insert(END, col3)     
       self.id_entry.insert(END, col9) 
    else:
       for n in self.list_agd_cad.selection():
       col1, col2, col3 = self.list_agd_cad.item(n, 'values')
       self.id_cad_entry.insert(END, col1)
       self.dia_semana_entry.insert(END, col2)
       self.dta_agenda_pessoa_entry.insert(END, col3)

I know it's wrong. How do I do right?

0 Answers
Related