Oscar jinxed
This commit is contained in:
@@ -7,6 +7,6 @@ class BTypeDAO:
|
||||
self.__cur = self.__con.cursor()
|
||||
|
||||
def getBType(self):
|
||||
self.__cur.callproc("getBType")
|
||||
self.__cur.callproc("getBtype", (None, None, ))
|
||||
data = self.__cur.fetchall()
|
||||
return(data)
|
||||
|
||||
@@ -15,7 +15,7 @@ class BusinessDAO:
|
||||
|
||||
def addBusiness(self, data):
|
||||
try:
|
||||
|
||||
print(data)
|
||||
self.__cur.callproc("addBusiness", (json.dumps(data),))
|
||||
self.__con.commit()
|
||||
|
||||
|
||||
@@ -11,3 +11,15 @@ class ContactDAO:
|
||||
|
||||
def getContacts(self):
|
||||
print(f"*** File: {__file__}, getContacts()")
|
||||
|
||||
def addContact(self, contact):
|
||||
try:
|
||||
contact_id = self.__cur.callproc("addContactPerson", (contact, 0, ))
|
||||
self.__con.commit()
|
||||
return contact_id[1]
|
||||
#except mariadb.Error as e:
|
||||
#print(str (e))
|
||||
except Exception as e:
|
||||
print(str (e))
|
||||
|
||||
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
from PySide6.QtCore import QAbstractTableModel, QModelIndex, Qt, Slot
|
||||
from PySide6.QtCore import QAbstractTableModel, QModelIndex, Qt, Slot, QObject
|
||||
from .ContactDAO import ContactDAO
|
||||
import logging
|
||||
import json
|
||||
|
||||
class ContactModel:
|
||||
class ContactModel(QObject):
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
#self.logger = logging.getLogger()
|
||||
@@ -18,3 +19,10 @@ class ContactModel:
|
||||
print(f"*** File: {__file__}, __getData()")
|
||||
ContactDAO().getContacts()
|
||||
|
||||
@Slot(dict)
|
||||
def addContact(self, contact):
|
||||
addC = ContactDAO()
|
||||
j = json.dumps(contact)
|
||||
a = addC.addContact(j)
|
||||
return a
|
||||
|
||||
|
||||
Reference in New Issue
Block a user