Try setting the layer editable and then turning editing off.  There seems (too me) to be a bug in the refreshing of the attributes on memory layers.<div><br></div><div>- Nathan <br><br><div class="gmail_quote">On Mon, Feb 28, 2011 at 10:50 PM, Ziegler Stefan <span dir="ltr">&lt;<a href="mailto:Stefan.Ziegler@bd.so.ch">Stefan.Ziegler@bd.so.ch</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">






<div>
<div><span style="font-size:10pt">Hi </span></div>
<br>
<div><span style="font-size:10pt">I&#39;m trying to add some
attributes to a memory provider but with no luck. I pasted the code from the
cookbook [1] into the python console. The layer with the feature is added but
there are no attributes in the layer. Did I miss something? Has something
changed?</span></div>
<br>
<div><span style="font-size:10pt">[1]:
<a href="http://www.qgis.org/pyqgis-cookbook/vector.html#memory-provider" target="_blank">http://www.qgis.org/pyqgis-cookbook/vector.html#memory-provider</a></span></div>
<br>
<div><span style="font-size:10pt">regards
</span><br><span style="font-size:10pt">Stefan</span></div>
<br>
<div><span style="font-size:10pt">Mit freundlichem
Gruss</span><br><span style="font-size:10pt">Stefan
Ziegler</span><br><span style="font-size:10pt">Leiter amtliche
Vermessung</span></div>
<br>
<div><span style="font-size:10pt">Kanton
Solothurn</span><br><span style="font-size:10pt">Bau- und
Justizdepartement</span><br><span style="font-size:10pt">Amt für
Geoinformation</span><br><span style="font-size:10pt">Rötistrasse
4</span><br><span style="font-size:10pt">4501
Solothurn</span><br><span style="font-size:10pt">Telefon 032 627 75
96</span><br><span style="font-size:10pt">Telefax 032 627 75
98</span><br><span style="font-size:10pt"><a href="mailto:stefan.ziegler@bd.so.ch" target="_blank">stefan.ziegler@bd.so.ch</a></span><br><span style="font-size:10pt"><a href="http://www.so.ch" target="_blank">http://www.so.ch</a></span></div>


<br>



</div>


<br>_______________________________________________<br>
Qgis-developer mailing list<br>
<a href="mailto:Qgis-developer@lists.osgeo.org">Qgis-developer@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/qgis-developer" target="_blank">http://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br>
<br></blockquote></div><br></div>