Exemplo n.º 1
0
 def delete_geom(self):
     '''delete defined table relation from the config '''
     if self.warningInfo(QApplication.translate('WorkspaceLoader',\
                             u"Are you sure you want to deleted selected geometry column from table (%s)")
                                                    %self.tableName) == QMessageBox.Yes:
         selCols=self.tblLookup_2.selectionModel().selectedIndexes()
         if len(selCols)>0:
             item=selCols[1].data()
             element="geometryz"
             deleteColumn(self.profile,'table',self.tableName,element,'column',str(item))
             self.loadTableRelations(self.tableName)
Exemplo n.º 2
0
 def deleteTableColumn(self):
     '''ensure we deleted the selected table column only by matching name entry in the config'''
     #try:
     if self.warningInfo(QApplication.translate('WorkspaceLoader',\
                                                "You are about to delete selected column from table (%s)"
                                                )%self.tableName) == QMessageBox.Yes:
         selCols=self.tblEdit.selectionModel().selectedIndexes()
         if len(selCols)>0:
             item = selCols[0].data()
             element = "columns"
             if str(self.tableName).startswith('check'):
                 deleteColumn(self.profile,'lookup',self.tableName,element,'name',str(item))
                 self.lookupColumnsTowidget(self.tableName)
             else:
                 deleteColumn(self.profile,'table',self.tableName,element,'name',str(item))
                 try:
                     deleteColumn(self.profile,'table',self.tableName,'constraints','column',str(item))
                 except Exception as ex:
                     self.ErrorInfoMessage(str(ex.message))
                 self.loadTableColumns(self.tableName)
     else:
         return