[Qgis-developer] updating multiple attribute values at once

karsten vennemann karsten at terragis.net
Sat Apr 23 04:44:20 EDT 2011


I am trying to update multiple values in an edit session via python
 
mc = self.canvas  
layer = mc.currentLayer()
provider = layer.dataProvider()                                         
ob = layer.selectedFeaturesIds() 
fid = int(ob[0])           
newvalues = { fid : { 3 : "lima", 4 : "city"}} 
provider.changeAttributeValues(newvalues)
 
However I am not getting an error nor does the update of the selected feature take place.
What is wrong with my code ?
 
Or is there another way of setting field default values ...
 
Thanks
Karsten 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/qgis-developer/attachments/20110423/7c5905f9/attachment-0001.html


More information about the Qgis-developer mailing list