divmod-users team mailing list archive
-
divmod-users team
-
Mailing list archive
-
Message #00013
Re: Axiom change logging
Hmm, that sounds interesting enough. Maybe I could add it as a common extra
special case (set a bunch of attributes).
I'm totally okay with change logging being explicit.
On Mon, Nov 5, 2012 at 2:02 PM, Tristan Seligmann
<mithrandi@xxxxxxxxxxxxx>wrote:
> 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
>
--
cheers
lvh
References