you are right, the code now works fine. It was just my fault due to to the fact that I'm trying to take ones first steps with pygis !
thanks for the support and sorry for the noise. Btw I also resolve my second problem described in the first mail. thanks Luca 2013/12/21 Enzo Ciarmoli <enzo.ciarm...@csi.it>: >> > nevertheless the problem remain the same: if i try to load the data >> > from a table without geometry, values for i.attributes()[1] remain >> > empty. > > Hi Luca, > I tried your sample code and it works... I don't know what's wrong in your > situation... > > If your problem remain the same, > I could suggest you to use QgsFeatureRequest with NoGeometry flag > > (see Detailed Description in: > http://www.qgis.org/api/classQgsFeatureRequest.html ) > > Example: > layer = QgsMapLayerRegistry.instance().mapLayersByName('your_table')[0] > iter = > layer.getFeatures(QgsFeatureRequest().setFlags(QgsFeatureRequest.NoGeometry)) > > for feat in iter: > print feat.attributes() > print feat.attributes()[0] > print feat.attributes()[1] > > > Ciao! > > Enzo _______________________________________________ Qgis-developer mailing list Qgis-developer@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-developer