def __init__(self, tableName, columnNames, relationType=NORMAL_RELATION, itemsCheckable=False): QtCore.QAbstractTableModel.__init__(self) if itemsCheckable: assert(relationType==IGNORE_RELATION) self.parentid = -1 self.idmap = [] self.rowCount = -1 self.columnCount = len(columnNames) self.tableName = tableName self.tableDisplayName = nafdb.getTableDisplayName(tableName) self.columnNames = columnNames self.columnstring = ','.join(columnNames) self.headerNames = nafdb.getHeaderDataForColumns(tableName, columnNames) self.orderClause = "" self.whereClause = "" self.relationType = relationType self.relatedidmap = [] self.itemsCheckable = [Qt.NoItemFlags, Qt.ItemIsUserCheckable][itemsCheckable]
def __init__(self, tableName, columnNames, relationType=NORMAL_RELATION, itemsCheckable=False): QtCore.QAbstractTableModel.__init__(self) if itemsCheckable: assert (relationType == IGNORE_RELATION) self.parentid = -1 self.idmap = [] self.rowCount = -1 self.columnCount = len(columnNames) self.tableName = tableName self.tableDisplayName = nafdb.getTableDisplayName(tableName) self.columnNames = columnNames self.columnstring = ','.join(columnNames) self.headerNames = nafdb.getHeaderDataForColumns( tableName, columnNames) self.orderClause = "" self.whereClause = "" self.relationType = relationType self.relatedidmap = [] self.itemsCheckable = [Qt.NoItemFlags, Qt.ItemIsUserCheckable][itemsCheckable]
def getLabel(self, column): return QtCore.QString(nafdb.getHeaderDataForColumns(self.tableName, (column,))[0])
def getLabel(self, column): return QtCore.QString(nafdb.getHeaderDataForColumns(self.tableName, (column,))[0])