http://docs.sqlalchemy.org/en/rel_0_8/orm/examples.html#versioned-objects
looks like what you may want.

On Mon, Nov 19, 2012 at 9:10 PM, LPG <[email protected]> wrote:
> I'm looking for details on implementing an audit table, either through sqla
> itself or in a way that plays nicely with sqla. It looks like there used to
> be an implementation of something like that at
> http://www.sqlalchemy.org/trac/wiki/UsageRecipes/LogVersions, does anyone
> know where that code lives now?
>
> I figure there is probably a way to define the history table entirely in
> sqla, or perhaps preferably with db triggers. I'm using PostgreSQL / the
> trigger option is certainly available. If I go the trigger route ... is
> there a way to still have access to the history table object through sqla? I
> suppose I create a mapping to that table?
>
> To illustrate the scenario, say I have a bank_account table:
>
> bank_account
>  - id
>  - balance
>
> And a history table for it:
>
> bank_account_history
>  - bid
>  - timestamp
>  - balance
>
> Should the history table implementation be done in sqla or should it be a db
> trigger with a sqla mapping? Either way I want to read from the history
> table with SQLA. Any pointers appreciated!
>
> --
> You received this message because you are subscribed to the Google Groups
> "sqlalchemy" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/sqlalchemy/-/Ru8xYbuARNsJ.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/sqlalchemy?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en.

Reply via email to