Testing logger and debug
This commit is contained in:
13
lib/DB/ContactDAO.py
Normal file
13
lib/DB/ContactDAO.py
Normal file
@@ -0,0 +1,13 @@
|
||||
from .DbManager import DbManager
|
||||
import json
|
||||
import mariadb
|
||||
|
||||
|
||||
class ContactDAO:
|
||||
def __init__(self):
|
||||
print(f"*** File: {__file__}, __init__()")
|
||||
self.__con = DbManager().getConnection()
|
||||
self.__cur = self.__con.cursor()
|
||||
|
||||
def getContacts(self):
|
||||
print(f"*** File: {__file__}, getContacts()")
|
||||
23
lib/DB/ContactModel.py
Normal file
23
lib/DB/ContactModel.py
Normal file
@@ -0,0 +1,23 @@
|
||||
from PySide6.QtCore import QAbstractTableModel, QModelIndex, Qt, Slot
|
||||
from .ContactDAO import ContactDAO
|
||||
import logging
|
||||
|
||||
logger = logging.getLogger()
|
||||
print(__name__)
|
||||
|
||||
class ContactModel:
|
||||
def __init__(self):
|
||||
print(f"*** File: {__file__}, __init__()")
|
||||
super().__init__()
|
||||
self.__data = self.__getData()
|
||||
|
||||
|
||||
def getContacts(self):
|
||||
print(f"*** File: {__file__}, getContacts()")
|
||||
logger.debug("A debug message")
|
||||
return self.__data
|
||||
|
||||
def __getData(self):
|
||||
print(f"*** File: {__file__}, __getData()")
|
||||
ContactDAO().getContacts()
|
||||
|
||||
Reference in New Issue
Block a user