Hi, In SQL, using triggers, it's possible to pre-process values before inserting/deleting/updating them. That's a very powerful feature for things such as validation, formatting, logging modifications, timestamping, caching, synchronization across table/databases, running other scripts, etc.
Is it possible to emulate this in QGIS with Python (so purely on client side) ? There is the QgsVectorLayer beforeCommitChanges signal, which is triggered exactly at the correct time, but I didn't find a way to iterate through the modified features, getting their OLD and NEW state. I think it may be possible to implement it using the attributeValueChanged (QgsFeatureId fid, int idx, const QVariant) and the geometryChanged (QgsFeatureId fid, QgsGeometry geom) signals to store a list of NEW states, and then make a new query to the data provider to get the OLD states (using QgsVectorDataProvider getFeatures). Would that work ? It's a bit sad that there's a new query to make to the provider. The best would be to have the attributeValueChanged and the geometryChanged signals to return the OLD value as well directly. Would this be a reasonable feature request ? Or is there another way to achieve the same result that I didn't think of ? Thanks a lot, Olivier
_______________________________________________ Qgis-developer mailing list [email protected] http://lists.osgeo.org/mailman/listinfo/qgis-developer
