<div dir="ltr">pendingFields is gone this morning: <a href="https://github.com/qgis/QGIS/pull/6050">https://github.com/qgis/QGIS/pull/6050</a><div>Maybe just use `fields()` ?</div></div><div class="gmail_extra"><br><div class="gmail_quote">2018-01-15 20:10 GMT+03:00 Andreas Neumann <span dir="ltr"><<a href="mailto:a.neumann@carto.net" target="_blank">a.neumann@carto.net</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="font-size:10pt;font-family:Verdana,Geneva,sans-serif">
<p>Hi,</p>
<p>I am trying to fix some Python code that worked before, but not anymore due to API changes in master meanwhile.</p>
<p>I am getting a reference to a layer by name and then want to query the 'pendingFields'. Here is the code I use:</p>
<p>---------------------</p>
<p>LayerParcels= QgsProject.instance().<wbr>layerStore().mapLayersByName('<wbr>Parcels')[0]</p>
<p>newParcel = QgsFeature()</p>
<p><span>newParcel </span>.setFields(<span>LayerParc<wbr>els</span>.pendingFields())</p>
<p>-------------------------</p>
<p>The first two lines seem to work, but the third line triggers an error:</p>
<p>AttributeError: 'QgsVectorLayer' object has no attribute 'pendingFields'</p>
<p>Why is that?</p>
<p>This code worked a few weeks before and the 'pendingFields' - according to <a href="https://qgis.org/api/classQgsVectorLayer.html" target="_blank">https://qgis.org/api/<wbr>classQgsVectorLayer.html</a> still exists?</p>
<p>What is wrong with my code?</p>
<p>Thanks for any hints!</p><span class="HOEnZb"><font color="#888888">
<p>Andreas</p>
<p><br></p>

</font></span></div>
<br>______________________________<wbr>_________________<br>
QGIS-Developer mailing list<br>
<a href="mailto:QGIS-Developer@lists.osgeo.org">QGIS-Developer@lists.osgeo.org</a><br>
List info: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-developer" rel="noreferrer" target="_blank">https://lists.osgeo.org/<wbr>mailman/listinfo/qgis-<wbr>developer</a><br>
Unsubscribe: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-developer" rel="noreferrer" target="_blank">https://lists.osgeo.org/<wbr>mailman/listinfo/qgis-<wbr>developer</a><br></blockquote></div><br></div>