Skip to content
Permalink
Browse files

DBManager: more SIP API update (fix #8132)

  • Loading branch information
brushtyler committed Jun 22, 2013
1 parent d1e4105 commit 49970b0413d6b042e734b327f50013e8d42b6e34
@@ -292,8 +292,8 @@ def _getNewObject(self):
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 @@ def updateTableColumn(self, table, column, new_name=None, data_type=None, not_nu
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 @@ def getTableExtent(self, table, geom):
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 @@ def isVectorTable(self, table):
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 @@ def accept(self):
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()

0 comments on commit 49970b0

Please sign in to comment.
You can’t perform that action at this time.