← Back to team overview

divmod-users team mailing list archive

Re: Axiom change logging

 

On Mon, Nov 5, 2012 at 2:47 PM, Laurens Van Houtven <_@xxxxxx> wrote:
> Do you happen to know of any easy shortcuts that would mean I don't have to
> keep all of the old state around in a dictionary and then compare it with
> the new state post transaction? A quick review of the code doesn't show any
> obvious places to do so.

Unfortunately not. We achieved something similar in our system by
introducing an extra layer of abstraction for modifying the items that
need to be change-logged. There's a method which receives kwargs for
new attribute values, and this method does the actual modifications as
well as logging them; if the transaction reverts instead of
committing, then the log entry items get reverted too, but obviously
any changes that do not go through this API are not logged at all.
-- 
mithrandi, i Ainil en-Balandor, a faer Ambar


Follow ups

References