Adding read and update to our model

Open models.py and consider what's missing from the CSVModel class:

  • We'll need a method that can retrieve all records in a file so we can display them. We'll call it get_all_records().
  • We'll need a method to fetch individual records from the file by row number. We can call this get_record().
  • We'll need to save records in a way that can not only append new records, but update existing records as well. We can update our save_record() method to accommodate this.

Get Python GUI Programming with Tkinter now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.