We have around 10 different tables in the database and we use
sqlalchemy's declarative base style table definition. We are happy
about it.

Now we need to have auditlog/history of changes made to database
records.

For example, the entry could be new recorded added or existing record
updated or deleted. These information should be reflected in the
database table called "history".

So we end up writing very simular code for every tables in our
database for each crud operation.

I am thinking whether we can have simplified solution like

1. We define our own custom class derived from declarative_base
instance
2. We derive the rest of our classes from our own custom class
mentioned in the step 1
3. Whenever there is changes in the record, Sqlalchemy to give
callback on post/pre operation and we capture those changes in the
derived class and use the history class to write the changes to the
database.

So we can derive all our future classes from this model and I will be
free to handle the rest of the information.

Can you please help me to implement this?

Regards,

Krisj

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

Reply via email to