Skip to content
Permalink
Browse files

[db manager] Fix virtual layers plugin (fixes #14404)

(cherry-picked from commit 7dbc0bf)
  • Loading branch information
Hugo Mercier
Hugo Mercier committed Mar 24, 2016
1 parent 8aa3ecd commit 363050db14092cd55a7c995d94ba5d5bb1d10f54
Showing with 8 additions and 4 deletions.
  1. +8 −4 python/plugins/db_manager/db_plugins/vlayers/data_model.py
@@ -26,9 +26,7 @@
from ..plugin import DbError

from PyQt4.QtCore import QUrl, QTime, QTemporaryFile
from qgis.core import QgsProviderRegistry, QgsErrorMessage, QGis, QgsVectorLayer

import os
from qgis.core import QGis, QgsVectorLayer, QgsWKBTypes


class LTableDataModel(TableDataModel):
@@ -48,7 +46,13 @@ def __init__(self, table, parent=None):
# populate self.resdata
self.resdata = []
for f in self.layer.getFeatures():
self.resdata.append(f.attributes())
a = f.attributes()
# add the geometry type
if f.geometry():
a.append(QgsWKBTypes.displayString(QGis.fromOldWkbType(f.geometry().wkbType())))
else:
a.append('None')
self.resdata.append(a)

self.fetchedFrom = 0
self.fetchedCount = len(self.resdata)

0 comments on commit 363050d

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