Use ORM for applicants

This commit is contained in:
Yuri Becker
2025-04-21 23:45:33 +02:00
parent 0ae153617b
commit 45f19d80d0
45 changed files with 388 additions and 354 deletions

View File

@@ -1,20 +1,21 @@
# This Python file uses the following encoding: utf-8
from .DbManager import DbManager
from ..PyqcrmFlags import PyqcrmFlags
import mariadb
from PySide6.QtCore import QObject, Signal
from lib.domain.BaseModel import database
class UserDAO(QObject):
noDbConnection = Signal(str)
__cursor = None
def __init__(self):
#print(f"*** File: {__file__}, init()")
super().__init__()
self.__con = DbManager().getConnection()
self.__con = database.connection()
if self.__con:
self.__cur = self.__con.cursor()
def createUser(self, username, password, info, role= PyqcrmFlags.USER):
def createUser(self, username, password, info, role=PyqcrmFlags.USER):
user_created = False
try:
if self.__cur:
@@ -39,6 +40,3 @@ class UserDAO(QObject):
except mariadb.Error as e:
print(str(e))
self.noDbConnection.emit(str(e))