Example #1
0
 def addTableColumn(self):
     '''add new attribute for the table'''
     if self.tableName!=None:
         colDlg=AttributeEditor(str(self.cboProfile.currentText()),self.tableName,self)
         colDlg.exec_()
         self.loadTableColumns(self.tableName)
     else:
         self.ErrorInfoMessage(QApplication.translate("WorkspaceLoader","Please select table to add attributes"))
         return
     self.populateLookup()
Example #2
0
 def columnEditor(self):
     '''Edit selected table column'''
     try:
         selCols=self.tblEdit.selectionModel().selectedIndexes() 
         EditorSession=[]
         if len(selCols)>0 and self.tableName!=None:
             EditorSession.append(selCols[0].data())
             EditorSession.append(selCols[1].data())
             EditorSession.append(selCols[2].data())
             EditorSession.append(selCols[3].data())
             EditorSession.append(selCols[4].data())
             EditorSession.append(selCols[5].data())
             colDlg = AttributeEditor(str(self.cboProfile.currentText()),self.tableName,self,args=EditorSession)
             colDlg.exec_()
         else:
             self.InfoMessage(QApplication.translate("WorkspaceLoader","No table column is selected for editing"))
             return
     except:
         pass 
     self.loadTableColumns(self.tableName)
     self.loadTableRelations(self.tableName)
     self.populateLookup()