<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type"/>
<style type="text/css">.mceResizeHandle {position: absolute;border: 1px solid black;background: #FFF;width: 5px;height: 5px;z-index: 10000}.mceResizeHandle:hover {background: #000}img[data-mce-selected] {outline: 1px solid black}img.mceClonedResizable, table.mceClonedResizable {position: absolute;outline: 1px dashed black;opacity: .5;z-index: 10000}
.mceResizeHandle {position: absolute;border: 1px solid black;background: #FFF;width: 5px;height: 5px;}
.mceResizeHandle:hover {background: #000;}
img[data-mce-selected] {}
img.mceClonedResizable, table.mceClonedResizable {position: absolute;}
</style></head><body style="">
<div>
> > nevertheless the problem remain the same: if i try to load the data
<br/>> > from a table without geometry, values for i.attributes()[1] remain empty.
<br/>
<span style="font-size: 9pt;"></span>
</div>
<div>
</div>
<div>
Hi Luca,
</div>
<div>
<span style="font-size: 9pt;">I tried your sample code and it works... I don't know what's wrong in your situation...</span>
</div>
<div>
<p>If your problem remain the same,<br/>I could suggest you to use QgsFeatureRequest with NoGeometry flag</p>
</div>
<div>
(see Detailed Description in: http://www.qgis.org/api/classQgsFeatureRequest.html )
<br/>
<br/>Example:
<br/>layer = QgsMapLayerRegistry.instance().mapLayersByName('your_table')[0]
<br/>iter = layer.getFeatures(QgsFeatureRequest().setFlags(QgsFeatureRequest.NoGeometry))
</div>
<div>
</div>
<div>
for feat in iter:
</div>
<div>
<span style="font-size: 9pt;"> print feat.attributes()</span>
</div>
<div>
<div>
<span> print feat.attributes()[0]</span>
</div>
<div>
<div>
<span> print feat.attributes()[1]</span>
</div>
<div>
<span> </span>
</div>
<div>
</div>
</div> Ciao!
</div>
<div>
<br/>Enzo
<br/>
</div>
</body></html>