Fixing the open_record() method

Next, we need to fix our open_record() method. It takes a rownum currently, but we no longer have row numbers; we have date, time, lab, and plot.

To reflect this, replace all instances of rownum with rowkey:

    def open_record(self, rowkey=None):
        if rowkey is None:
        # ...etc

Finally, expand rowkey in the get_record() call, since it expects four positional arguments:

        record = self.data_model.get_record(*rowkey)

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.