mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-14 00:07:35 -04:00
DBManager: more SIP API update (fix #8132)
This commit is contained in:
parent
d1e410585b
commit
49970b0413
@ -292,8 +292,8 @@ class TableIndexesModel(SimpleTableModel):
|
||||
def getObject(self, row):
|
||||
val = self.data(self.index(row, 0), Qt.UserRole)
|
||||
idx = val.toPyObject() if val.isValid() else self._getNewObject()
|
||||
idx.name = self.data(self.index(row, 0)).toString()
|
||||
idx.columns = self.data(self.index(row, 1), Qt.UserRole).toList()
|
||||
idx.name = self.data(self.index(row, 0))
|
||||
idx.columns = self.data(self.index(row, 1), Qt.UserRole)
|
||||
return idx
|
||||
|
||||
def getIndexes(self):
|
||||
|
@ -757,16 +757,16 @@ class PostGisDBConnector(DBConnector):
|
||||
c = self._get_cursor()
|
||||
|
||||
# update column definition
|
||||
col_actions = QStringList()
|
||||
col_actions = []
|
||||
if data_type != None:
|
||||
col_actions << u"TYPE %s" % data_type
|
||||
col_actions.append( u"TYPE %s" % data_type )
|
||||
if not_null != None:
|
||||
col_actions << (u"SET NOT NULL" if not_null else u"DROP NOT NULL")
|
||||
col_actions.append( u"SET NOT NULL" if not_null else u"DROP NOT NULL" )
|
||||
if default != None:
|
||||
if default and default != '':
|
||||
col_actions << u"SET DEFAULT %s" % default
|
||||
col_actions.append( u"SET DEFAULT %s" % default )
|
||||
else:
|
||||
col_actions << u"DROP DEFAULT"
|
||||
col_actions.append( u"DROP DEFAULT" )
|
||||
if len(col_actions) > 0:
|
||||
sql = u"ALTER TABLE %s" % self.quoteId(table)
|
||||
alter_col_str = u"ALTER %s" % self.quoteId(column)
|
||||
|
@ -314,7 +314,7 @@ class SpatiaLiteDBConnector(DBConnector):
|
||||
c = self._get_cursor()
|
||||
|
||||
if self.isRasterTable(table):
|
||||
tablename = QString(tablename).replace('_rasters', '_metadata')
|
||||
tablename = tablename.replace('_rasters', '_metadata')
|
||||
geom = u'geometry'
|
||||
|
||||
sql = u"""SELECT Min(MbrMinX(%(geom)s)), Min(MbrMinY(%(geom)s)), Max(MbrMaxX(%(geom)s)), Max(MbrMaxY(%(geom)s))
|
||||
@ -348,7 +348,7 @@ class SpatiaLiteDBConnector(DBConnector):
|
||||
def isRasterTable(self, table):
|
||||
if self.has_geometry_columns and self.has_raster:
|
||||
schema, tablename = self.getSchemaTableName(table)
|
||||
if not QString(tablename).endsWith( "_rasters" ):
|
||||
if not tablename.endswith( "_rasters" ):
|
||||
return False
|
||||
|
||||
sql = u"""SELECT count(*)
|
||||
|
@ -273,10 +273,10 @@ class DlgImportVector(QDialog, Ui_Dialog):
|
||||
geom = self.outUri.geometryColumn() if not self.chkGeomColumn.isChecked() else self.editGeomColumn.text()
|
||||
geom = geom if geom != "" else self.default_geom
|
||||
else:
|
||||
geom = QString()
|
||||
geom = ""
|
||||
|
||||
# get output params, update output URI
|
||||
self.outUri.setDataSource( schema, table, geom, QString(), pk )
|
||||
self.outUri.setDataSource( schema, table, geom, "", pk )
|
||||
uri = self.outUri.uri()
|
||||
|
||||
providerName = self.db.dbplugin().providerName()
|
||||
|
Loading…
x
Reference in New Issue
Block a user