[sqlalchemy] AuditLog/History logging

2010-11-03 Thread Gopalakrishnan Subramani
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

[sqlalchemy] Insert from select?!

2010-11-03 Thread Torsten Landschoff
Hi *, I am wondering if there is a way to generate an insert from select with SQLAlchemy. Consider this code: from sqlalchemy import * engine = create_engine(sqlite:///demo.ldb, echo=True) md = MetaData() users = Table(users, md, Column(id, Integer, primary_key=True), Column(name,

Re: [sqlalchemy] Insert from select?!

2010-11-03 Thread akm
Try this http://www.sqlalchemy.org/docs/05/reference/ext/compiler.html?highlight=compiler#compiling-sub-elements-of-a-custom-expression-construct -- Abdul Kader On Wed, Nov 3, 2010 at 5:09 PM, Torsten Landschoff torsten.landsch...@dynamore.de wrote: Hi *, I am wondering if there is a way to

Re: [sqlalchemy] AuditLog/History logging

2010-11-03 Thread chaouche yacine
I know that elixir has an extension that does just this. You don't have to subclass, you just use a acts_as_versioned statement in your class definition and that's it. In addition, it will let you get the object at any of its verison (you can revert back changes, a sort of undo

Re: [sqlalchemy] AuditLog/History logging

2010-11-03 Thread chaouche yacine
http://www.sqlalchemy.org/docs/orm/examples.html?highlight=versioning#versioning You can find other interesting recipes in : http://www.sqlalchemy.org/trac/wiki/UsageRecipes Cheers, Y.Chaouche - Original Message From: Gopalakrishnan Subramani gopalakrishnan.subram...@gmail.com To:

Re: [sqlalchemy] Insert from select?!

2010-11-03 Thread Torsten Landschoff
On Wed, 2010-11-03 at 17:16 +0530, akm wrote: Try this http://www.sqlalchemy.org/docs/05/reference/ext/compiler.html?highlight=compiler#compiling-sub-elements-of-a-custom-expression-construct Thanks for the pointer, missed that before. So it is in fact doable :) Greetings, Torsten --

Re: [sqlalchemy] Connection / disconnect / Pool

2010-11-03 Thread Michael Bayer
On Nov 2, 2010, at 11:46 PM, Warwick Prince wrote: Hi Michael I have an issue I can't fathom regarding Pools.I'm doing testing and hit the following error at exatly the same point each time; File C:\Documents and Settings\wprince\Desktop\PY CODE DEVELOPMENT\pyDAP\DAPForm.py,

Re: [sqlalchemy] Connection / disconnect / Pool

2010-11-03 Thread Michael Bayer
On Nov 3, 2010, at 10:11 AM, Michael Bayer wrote: On Nov 2, 2010, at 11:46 PM, Warwick Prince wrote: Hi Michael I have an issue I can't fathom regarding Pools.I'm doing testing and hit the following error at exatly the same point each time; File C:\Documents and

[sqlalchemy] Re: AuditLog/History logging

2010-11-03 Thread Gopalakrishnan Subramani
Chaouche, Thank you for information. At the instance level, how will I know whether the instance going to be deleted or updated or insert. How do I get the property? And during update, how to identify which field has been modified? Regards, Krish On Nov 3, 6:30 pm, chaouche yacine

Re: [sqlalchemy] Connection / disconnect / Pool

2010-11-03 Thread Warwick Prince
Excellent. That'll be it for sure. I have a bunch of result sets that I assumed would just go away.. :-) Cheers Warwick Warwick A. Prince Managing Director Mushroom Systems International P/L On 04/11/2010, at 1:11 AM, Michael Bayer mike...@zzzcomputing.com wrote: On Nov 2, 2010, at 11:46