<div dir="ltr">Hi Enzo,<div><br></div><div>I return to this old discussion because I noticed that the problem that I described still remain the same when I use Qgis 2.0. On the contrary when I use Qgis 2.1 all works fine. </div>
<div>I didn't  full understand this problem previously  because I use qgis 2.0 on my works PC and and 2.1 with linux on my laptop.</div><div><br></div><div>Anyway I resolve the problem whit Qgis 2.0 using your tip of <span style="font-family:arial,sans-serif;font-size:13px">QgsFeatureRequest with NoGeometry flag, so the mail is just to keep track of the problem.</span><br>
</div><div><br></div><div>thanks again.<br></div><div>Luca </div></div><div class="gmail_extra"><br><br><div class="gmail_quote">2013/12/21 Luca Lanteri <span dir="ltr"><<a href="mailto:mescal72@gmail.com" target="_blank">mescal72@gmail.com</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">you are right, the code now works fine.<br>
It was just my fault due to to the fact that I'm trying to take ones<br>
first steps with pygis !<br>
<br>
thanks for the support and sorry for the noise.<br>
<br>
Btw I also resolve my second problem described in the first mail.<br>
<br>
thanks<br>
Luca<br>
<br>
2013/12/21 Enzo Ciarmoli <<a href="mailto:enzo.ciarmoli@csi.it">enzo.ciarmoli@csi.it</a>>:<br>
<div class="HOEnZb"><div class="h5">>> > 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<br>
>> > empty.<br>
><br>
> Hi Luca,<br>
> I tried your sample code and it works... I don't know what's wrong in your<br>
> situation...<br>
><br>
> If your problem remain the same,<br>
> I could suggest you to use QgsFeatureRequest with NoGeometry flag<br>
><br>
> (see Detailed Description in:<br>
> <a href="http://www.qgis.org/api/classQgsFeatureRequest.html" target="_blank">http://www.qgis.org/api/classQgsFeatureRequest.html</a> )<br>
><br>
> Example:<br>
> layer = QgsMapLayerRegistry.instance().mapLayersByName('your_table')[0]<br>
> iter =<br>
> layer.getFeatures(QgsFeatureRequest().setFlags(QgsFeatureRequest.NoGeometry))<br>
><br>
> for feat in iter:<br>
>     print feat.attributes()<br>
>     print feat.attributes()[0]<br>
>     print feat.attributes()[1]<br>
><br>
><br>
> Ciao!<br>
><br>
> Enzo<br>
</div></div></blockquote></div><br></div>