Now I can go to bed
This commit is contained in:
@@ -66,11 +66,13 @@ class BusinessModel(QAbstractTableModel):
|
|||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super().__init__()
|
super().__init__()
|
||||||
self.__data = self.__getData()
|
self.__getData()
|
||||||
|
|
||||||
def __getData(self, criterion = "Alle"):
|
def __getData(self, criterion = "Alle"):
|
||||||
|
self.beginResetModel()
|
||||||
rows, self.__visible_columns = BusinessDAO().getBusiness(criterion)
|
rows, self.__visible_columns = BusinessDAO().getBusiness(criterion)
|
||||||
return rows
|
self.__data = rows
|
||||||
|
self.endResetModel()
|
||||||
|
|
||||||
def rowCount(self, parent= QModelIndex()):
|
def rowCount(self, parent= QModelIndex()):
|
||||||
return len (self.__data)
|
return len (self.__data)
|
||||||
@@ -109,14 +111,13 @@ class BusinessModel(QAbstractTableModel):
|
|||||||
|
|
||||||
@Slot(str)
|
@Slot(str)
|
||||||
def viewCriterion(self, criterion):
|
def viewCriterion(self, criterion):
|
||||||
self.beginResetModel()
|
self.__getData(criterion)
|
||||||
self.__data = self.__getData(criterion)
|
|
||||||
self.endResetModel()
|
|
||||||
|
|
||||||
@Slot(dict, int)
|
@Slot(dict, int)
|
||||||
def addBusiness(self, business, contact_id):
|
def addBusiness(self, business, contact_id):
|
||||||
BusinessDAO().addBusiness(business, contact_id)
|
BusinessDAO().addBusiness(business, contact_id)
|
||||||
self.__data = self.__getData()
|
self.__getData()
|
||||||
|
|
||||||
@Slot(dict)
|
@Slot(dict)
|
||||||
def setContact(self, contact):
|
def setContact(self, contact):
|
||||||
|
|||||||
Reference in New Issue
Block a user