I'm trying to make a database management program in Python and Tkinter that relies on user input for updating it. The script goes like this:

User searches for records.
Selects an entry in treeview widget.
Selection populates all of the Entry fields.
User changes one or more values in them.
Program updates the database with the new values

My problem is this: How do I compare the old value (that came from selecting in threeview) and the new value (that user changed)?
I have an idea for a loop that 'scans' the new and old values and based on that executes UPDATE query on the changed column, but I can't get the value that is in the Entry widget.
You need to let the database do the work, i.e you let the database search for the record and update it based on a value. This value must be unique, an ID.
So what should happen:

The user chooses the record and the new value
You have the ID of the record and the new value
Call your ORM's update function, which should accept the ID of the record and the new value
Update database based on user input