switched to model instead of connector, extracts config from parent
This commit is contained in:
@@ -3,7 +3,7 @@ from configparser import NoSectionError, NoOptionError
|
||||
from tkinter import font, filedialog, messagebox
|
||||
|
||||
from config import Config
|
||||
from connector import JSONConnector
|
||||
from model import Model
|
||||
|
||||
|
||||
def show_error(message_title: str, message: str, parent: tk.Tk | tk.Toplevel):
|
||||
@@ -18,6 +18,7 @@ class Window(tk.Toplevel):
|
||||
def __init__(self, parent, root: tk.Tk):
|
||||
super().__init__(root)
|
||||
self.parent = parent
|
||||
self.config = parent.config
|
||||
self.root = root
|
||||
self.protocol("WM_DELETE_WINDOW", self.close_window)
|
||||
self.bind("<Escape>", self.close_window)
|
||||
@@ -36,7 +37,7 @@ class EditRecord(Window):
|
||||
super().__init__(parent, root)
|
||||
self.bind("<Return>", self._update)
|
||||
|
||||
self.model = JSONConnector()
|
||||
self.model = Model(self.config)
|
||||
|
||||
record = self.model.get_by_id(record_id)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user