pendingFields is gone this morning: https://github.com/qgis/QGIS/pull/6050 Maybe just use `fields()` ?
2018-01-15 20:10 GMT+03:00 Andreas Neumann <[email protected]>: > Hi, > > I am trying to fix some Python code that worked before, but not anymore > due to API changes in master meanwhile. > > I am getting a reference to a layer by name and then want to query the > 'pendingFields'. Here is the code I use: > > --------------------- > > LayerParcels= QgsProject.instance().layerStore().mapLayersByName(' > Parcels')[0] > > newParcel = QgsFeature() > > newParcel .setFields(LayerParcels.pendingFields()) > > ------------------------- > > The first two lines seem to work, but the third line triggers an error: > > AttributeError: 'QgsVectorLayer' object has no attribute 'pendingFields' > > Why is that? > > This code worked a few weeks before and the 'pendingFields' - according to > https://qgis.org/api/classQgsVectorLayer.html still exists? > > What is wrong with my code? > > Thanks for any hints! > > Andreas > > > > _______________________________________________ > QGIS-Developer mailing list > [email protected] > List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer > Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer >
_______________________________________________ QGIS-Developer mailing list [email protected] List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer
