[Qgis-user] QGIS custom feature forms with python logic - passed in feature

Jen Swiger swiger.jen at gmail.com
Wed Mar 15 14:00:05 PDT 2017


Hello,

I hope I am asking this question in the right email list. I may ask in the
qgis stack exchange as well.

I am working off this example
https://nathanw.net/2011/09/05/qgis-tips-custom-feature-forms-with-python-logic/
and adjusting to meet my needs.

When the formOpen function is called, the dialog, layer, and feature is
passed in.

I want to edit the feature that is passed in but code like
mylayer.changeAttribute(myfeature.id(), 10, 1)
doesn't seem to be working because myfeature.id() returns 0.

What code should I be using instead to edit a field in the feature?

Thanks!
Jen
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20170315/be3edd8f/attachment.html>


More information about the Qgis-user mailing list