<div dir="ltr">Hi,<br><br>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.<br><br>Is it possible to emulate this in QGIS with Python (so purely on client side) ?<br>There is the <font face="monospace, monospace" style="background-color:rgb(204,204,204)">QgsVectorLayer beforeCommitChanges</font> 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.<br><br>I think it may be possible to implement it using the <span style="background-color:rgb(204,204,204)"><font face="monospace, monospace">attributeValueChanged (QgsFeatureId fid, int idx, const QVariant)</font></span> and the <font face="monospace, monospace" style="background-color:rgb(204,204,204)">geometryChanged (QgsFeatureId fid, QgsGeometry geom)</font> 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).<div><br></div><div>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 <span style="font-family:monospace,monospace;background-color:rgb(204,204,204)">attributeValueChanged</span> and the <span style="font-family:monospace,monospace;background-color:rgb(204,204,204)">geometryChanged</span> signals to return the OLD value as well directly. Would this be a reasonable feature request ?<div><br>Or is there another way to achieve the same result that I didn't think of ?<br><br>Thanks a lot,<br><br>Olivier<br><br><br><br></div></div></div>