Re: [sqlalchemy] automap_base with mapped class

2017-03-11 Thread Vijaya Sekar
Yeah I done it thank u mike -- SQLAlchemy - The Python SQL Toolkit and Object Relational Mapper http://www.sqlalchemy.org/ To post example code, please provide an MCVE: Minimal, Complete, and Verifiable Example. See http://stackoverflow.com/help/mcve for a full description. --- You

[sqlalchemy] can't debug a failed relationship declaration

2017-03-11 Thread Jonathan Vanasco
I can't seem to declare a valid relationship in my application, but can do so as a self-contained example. the (working) example on the relevant columns is this: class IpAddress(Base): __tablename__ = 'ip_address' id = Column(Integer, primary_key=True)

Re: [sqlalchemy] Looks like there is no event to catch "before" a rollback happens

2017-03-11 Thread mike bayer
On 03/11/2017 10:15 AM, mike bayer wrote: On 03/10/2017 11:12 AM, Alessandro Molina wrote: On Fri, Mar 10, 2017 at 3:40 PM, mike bayer > wrote: If this is truly, "unexpected error but we need to do things", perhaps you

Re: [sqlalchemy] Looks like there is no event to catch "before" a rollback happens

2017-03-11 Thread mike bayer
On 03/10/2017 11:12 AM, Alessandro Molina wrote: On Fri, Mar 10, 2017 at 3:40 PM, mike bayer > wrote: If this is truly, "unexpected error but we need to do things", perhaps you can use before_flush() to memoize the details

Re: [sqlalchemy] automap_base with mapped class

2017-03-11 Thread mike bayer
On 03/11/2017 01:17 AM, Vijaya Sekar wrote: from sqlalchemy.ext.automap import automap_base from sqlalchemy import create_engine, MetaData lists = ['employees','address'] engine = create_engine("sqlite:///chinook.db") metadata = MetaData() metadata.reflect(engine, only=lists) Base =