it's QgsEditException. The edit(layer) statement is working just fine.
On Thu, Jun 14, 2018, 8:11 PM Thomas Baumann
wrote:
> Hello,
> isnt it "QgsEditError" instead of "QgsEditException"?
>
> regards,
> Thomas
>
>
> Am Do., 14. Juni 2018 um 03:26 Uhr schrieb Zhang Qun >:
>
>> Hi Matthias
>>
>>
Hello,
isnt it "QgsEditError" instead of "QgsEditException"?
regards,
Thomas
Am Do., 14. Juni 2018 um 03:26 Uhr schrieb Zhang Qun :
> Hi Matthias
>
> I follow the steps in the link you posted and get the following errors
> when trying to import
>
> ImportError: cannot import name
Hi Matthias
I follow the steps in the link you posted and get the following errors when
trying to import
ImportError: cannot import name QgsEditException
Do I have to install some modules? Didn't find any luck on google.
Best regards,
Zhang Qun
On Wed, Jun 13, 2018 at 6:16 PM, Matthias Kuhn
Thanks Matthias. Got it. I was just trying to not flood messages to those
pals who may not be interested.
Best regards,
Ethan
On Wed, Jun 13, 2018 at 6:16 PM, Matthias Kuhn wrote:
> Glad you like it :)
>
> Forwading this answer also to the mailing list for future reference,
> Ethan, you need
Glad you like it :)
Forwading this answer also to the mailing list for future reference,
Ethan, you need to use "reply to all" in your mail application or other
are not able to follow our conversation (which would be a pity ;) ).
Best regards
Matthias
On 06/13/2018 12:13 PM, Zhang Qun wrote:
>
Hi Ethan,
there are of course advantages and disadvantages of both methods, but in
most cases the QgsVectorLayer ones just "do the right thing", especially
when used with a `with` block, see also this post:
http://www.opengis.ch/2015/08/12/with-edit-layer/
Cheers
Matthias
On 06/13/2018 11:59
Hi Ethan
On 06/13/2018 11:18 AM, Zhang Qun wrote:
> Hi everyone, i"m using QGIS2.18, and trying to change feature attributes
> using the following two methods:
>
> *dataProvider:*
>
> |attrs ={0:"hello",1:123}layer.dataProvider().changeAttributeValues({fid
> :attrs })|
>
> *layer object:*
>
>
Hi everyone, i"m using QGIS2.18, and trying to change feature attributes
using the following two methods:
*dataProvider:*
attrs = { 0 : "hello", 1 : 123 }
layer.dataProvider().changeAttributeValues({ fid : attrs })
*layer object:*
layer.startEditing()
layer.changeAttributeValue(fid,