<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<p>Thanks - that's a good hint!</p>
<p>Andreas<br>
</p>
<br>
<div class="moz-cite-prefix">On 15.01.2018 18:20, Etienne Trimaille
wrote:<br>
</div>
<blockquote type="cite"
cite="mid:CAMtDFL+ve_dqcpDjBnenh9_KAWUXfpGgnqjr4HcfsrmKDSpt8A@mail.gmail.com">
<div dir="ltr">
<div>While I'm porting my plugin, I'm usually opening this doc<br>
</div>
<div><a
href="https://github.com/qgis/QGIS/blob/master/doc/api_break.dox"
moz-do-not-send="true">https://github.com/qgis/QGIS/blob/master/doc/api_break.dox</a></div>
<div><br>
</div>
<div>Then I search for every new exception I have, I often find
a solution there.</div>
</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">2018-01-15 20:14 GMT+03:00 Etienne
Trimaille <span dir="ltr"><<a
href="mailto:etienne.trimaille@gmail.com" target="_blank"
moz-do-not-send="true">etienne.trimaille@gmail.com</a>></span>:<br>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">pendingFields is gone this morning: <a
href="https://github.com/qgis/QGIS/pull/6050"
target="_blank" moz-do-not-send="true">https://github.com/<wbr>qgis/QGIS/pull/6050</a>
<div>Maybe just use `fields()` ?</div>
</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">
<div>
<div class="h5">2018-01-15 20:10 GMT+03:00 Andreas
Neumann <span dir="ltr"><<a
href="mailto:a.neumann@carto.net"
target="_blank" moz-do-not-send="true">a.neumann@carto.net</a>></span>:<br>
</div>
</div>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>
<div class="h5">
<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().layerSto<wbr>re().mapLayersByName('Parcels'<wbr>)[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" moz-do-not-send="true">https://qgis.org/api/classQ<wbr>gsVectorLayer.html</a> still
exists?</p>
<p>What is wrong with my code?</p>
<p>Thanks for any hints!</p>
<span class="m_9105683527195768469HOEnZb"><font
color="#888888">
<p>Andreas</p>
<p><br>
</p>
</font></span></div>
<br>
</div>
</div>
______________________________<wbr>_________________<br>
QGIS-Developer mailing list<br>
<a href="mailto:QGIS-Developer@lists.osgeo.org"
target="_blank" moz-do-not-send="true">QGIS-Developer@lists.osgeo.org</a><br>
List info: <a
href="https://lists.osgeo.org/mailman/listinfo/qgis-developer"
rel="noreferrer" target="_blank"
moz-do-not-send="true">https://lists.osgeo.org/mailma<wbr>n/listinfo/qgis-developer</a><br>
Unsubscribe: <a
href="https://lists.osgeo.org/mailman/listinfo/qgis-developer"
rel="noreferrer" target="_blank"
moz-do-not-send="true">https://lists.osgeo.org/mailma<wbr>n/listinfo/qgis-developer</a><br>
</blockquote>
</div>
<br>
</div>
</blockquote>
</div>
<br>
</div>
</blockquote>
<br>
</body>
</html>