<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /></head><body style='font-size: 10pt; font-family: Verdana,Geneva,sans-serif'>
<p>Hi,</p>
<p>oh - thanks, Etienne and Alessandro. If this change is that recent, than it explains why the API doc and the API break document doesn't mention it: https://qgis.org/api/api_break.html</p>
<p>But - aren't we in hard freeze (no more API changes) now since a few days already?</p>
<p>Being confused ....</p>
<p>Andreas</p>
<p>On 2018-01-15 18:14, Etienne Trimaille wrote:</p>
<blockquote type="cite" style="padding: 0 0.4em; border-left: #1010ff 2px solid; margin: 0"><!-- html ignored --><!-- head ignored --><!-- meta ignored -->
<div dir="ltr">pendingFields is gone this morning: <a href="https://github.com/qgis/QGIS/pull/6050" target="_blank" rel="noopener noreferrer">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><<a href="mailto:a.neumann@carto.net">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" rel="noopener noreferrer">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>
<p>Andreas</p>
<p><br /></p>
</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" target="_blank" rel="noopener noreferrer">https://lists.osgeo.org/<wbr />mailman/listinfo/qgis-<wbr />developer</a><br /> Unsubscribe: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-developer" target="_blank" rel="noopener noreferrer">https://lists.osgeo.org/<wbr />mailman/listinfo/qgis-<wbr />developer</a></blockquote>
</div>
</div>
</blockquote>
<p><br /></p>

</body></html>