コード例 #1
0
ファイル: _naf_itemmodel.py プロジェクト: VCTLabs/openadams
 def resetData(self):
     self.rowCount = 0
     self.columnCount = 0
     self.columns = nafdb.getColumnNames(self.tableName)
     self.columnCount = len(self.columns)
     if nafdb.connection is not None:
         self.cur = nafdb.connection.cursor()
         # here rowCount actually means the largest requirement id, not the number of requirements
         self.cur.execute("select max(id) from %s;" % self.tableName)
         n = self.cur.fetchone()[0]
         if n is not None:
             self.rowCount = int(n) + 1
         else:
             self.rowCount = 0
         for lutTableName, lookupModel in self.lookupModel.iteritems():
             lutTableRows = [self._translate(item) for item in nafdb.getLookupTableRows(lutTableName)]
             lookupModel.setStringList(lutTableRows)
         for historyTableName, historyModel in self.historyModel.iteritems():
             historyModel.setStringList(nafdb.getHistoryTableRows(historyTableName))
コード例 #2
0
ファイル: _naf_itemmodel.py プロジェクト: pmzhou/openadams
 def resetData(self):
     self.rowCount = 0
     self.columnCount = 0
     self.columns = nafdb.getColumnNames(self.tableName)
     self.columnCount = len(self.columns)
     if nafdb.connection is not None:
         self.cur = nafdb.connection.cursor()
         # here rowCount actually means the largest requirement id, not the number of requirements
         self.cur.execute('select max(id) from %s;' % self.tableName)
         n = self.cur.fetchone()[0]
         if n is not None:
             self.rowCount =  int(n)+1
         else:
             self.rowCount = 0
         for lutTableName, lookupModel in self.lookupModel.iteritems():
             lutTableRows = [self._translate(item) for item in nafdb.getLookupTableRows(lutTableName)]
             lookupModel.setStringList(lutTableRows)
         for historyTableName, historyModel in self.historyModel.iteritems():
             historyModel.setStringList(nafdb.getHistoryTableRows(historyTableName))
コード例 #3
0
ファイル: _naf_itemmodel.py プロジェクト: VCTLabs/openadams
 def getHistoryModel(self, historyTableName):
     if not self.historyModel.has_key(historyTableName):
         self.historyModel[historyTableName] = QtGui.QStringListModel(nafdb.getHistoryTableRows(historyTableName))
     return self.historyModel[historyTableName]
コード例 #4
0
ファイル: _naf_itemmodel.py プロジェクト: pmzhou/openadams
 def getHistoryModel(self, historyTableName):
     if not self.historyModel.has_key(historyTableName):
         self.historyModel[historyTableName] = QtGui.QStringListModel(nafdb.getHistoryTableRows(historyTableName))
     return self.historyModel[historyTableName]