Use ORM for applicants
This commit is contained in:
@@ -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))
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user