0

Hello, my code at the minute fetches a record and splits it up into a tuple, this is so each individual element can be displayed in an entry. I am now trying to create a feature which reads what is in the entrybox and updates the record in the database. This is the current code:

 def Update(self):

        global Record
        global Name
        global TrainerID
        global Postcode
        global Age
        global Gender
        global Password

        (Name, TrainerID, Postcode, Age, Gender, Password) = tuple(Record)

        Name = self.ent_Name.get()
        TrainerID = self.ent_TrainerID.get()
        Postcode = self.ent_Postcode.get()
        Age = self.ent_Age.get()
        Gender = self.ent_Gender.get()
        Password = self.ent_Password.get()

        List = [Name, TrainerID, Postcode, Age, Gender, Password]

        self.cur.execute("UPDATE Trainers SET Name=?, TrainerID=?, Postcode=?,Age,=? Gender=?, Password=?",((Name,) (TrainerID,) (Postcode,) (Age,) (Gender,) (Password,)))

When I open the program and try to update the record the following error appears:  

TypeError: 'tuple' object is not callable

Thanks for any help!

1
Contributor
0
Replies
7
Views
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.