Object contact logic implemented

This commit is contained in:
2025-03-12 09:50:06 +01:00
parent 767200096f
commit e3053be72e
8 changed files with 95 additions and 43 deletions

View File

@@ -6,7 +6,7 @@ import re
import json
class ObjectModel(QAbstractTableModel):
objectAdded = Signal(bool)
objectAdded = Signal(bool, int)
__data = None
__object_dao = None
@@ -27,13 +27,11 @@ class ObjectModel(QAbstractTableModel):
self.__object_dao.newObjectAdded.connect(self.objectAdded)
self.__getData()
@Slot(dict, list, bool)
def addObject(self, new_object, new_objcontact = None, new_contact = False):
@Slot(dict)
def addObject(self, new_object):
#print(new_object)
print(new_objcontact)
#self.__object_dao.addObject(new_object, new_objcontact, self.__key)
o = self.__object_dao.addObject(new_object)
# @Slot(str)
# def viewCriterion(self, criterion, processed = False, fired = False):
@@ -57,15 +55,16 @@ class ObjectModel(QAbstractTableModel):
@Slot(str)
def viewCriterion(self, criterion):
print(f"Criterion: {criterion}")
self.__getData(criterion)
def data(self, index, role= Qt.DisplayRole):
if role == Qt.DisplayRole:
row = self.__data[index.row()]
applicant_col = index.column() + self.__col_skip
tr = row[applicant_col] #if type(row[index.column() + 2]) is str else str(row[index.column() + 2], "utf-8")
#print(f"Data: {tr}")
# return row[index.column() + 2]
object_col = index.column() + self.__col_skip
tr = row[object_col] #if type(row[index.column() + 2]) is str else str(row[index.column() + 2], "utf-8")
if object_col > 4 and tr:
tr = re.sub("Keine Angabe ","", tr)
return tr
return None