Re: [sqlalchemy] declarative and late reflection?

2011-12-27 Thread peter sabaini
Cool -- works nicely, thanks again! On Fri, Dec 23, 2011 at 2:56 AM, Michael Bayer mike...@zzzcomputing.comwrote: On Dec 22, 2011, at 7:28 PM, Michael Bayer wrote: this could work really nicely with extend_existing, which has been enhanced in 0.7.4, but there seem to be some glitches

[sqlalchemy] declarative and late reflection?

2011-12-22 Thread peter sabaini
Hey list, this sounds like it should be a FAQ, didn't find anything though: I want to use the ORM in a declarative style and have the table definition reflected, eg sth like: class A(declarative_base()): __tablename__ = 'A' __table_args__ = {'autoload' : True} However to do this SA

Re: [sqlalchemy] declarative and late reflection?

2011-12-22 Thread Michael Bayer
On Dec 22, 2011, at 9:37 AM, peter sabaini wrote: Hey list, this sounds like it should be a FAQ, didn't find anything though: I want to use the ORM in a declarative style and have the table definition reflected, eg sth like: class A(declarative_base()): __tablename__ = 'A'

Re: [sqlalchemy] declarative and late reflection?

2011-12-22 Thread peter sabaini
Hey! This works for me -- almost :-) In my use case I need to override a column (to provide an artificial FK -- some *erm old school mysql db) which seems to trigger SA into trying to reflect early Observe: from sqlalchemy import * from sqlalchemy.orm import * from sqlalchemy.ext.declarative

Re: [sqlalchemy] declarative and late reflection?

2011-12-22 Thread Michael Bayer
On Dec 22, 2011, at 11:48 AM, peter sabaini wrote: Hey! This works for me -- almost :-) In my use case I need to override a column (to provide an artificial FK -- some *erm old school mysql db) which seems to trigger SA into trying to reflect early Observe: from sqlalchemy

Re: [sqlalchemy] declarative and late reflection?

2011-12-22 Thread Michael Bayer
On Dec 22, 2011, at 7:28 PM, Michael Bayer wrote: this could work really nicely with extend_existing, which has been enhanced in 0.7.4, but there seem to be some glitches preventing it from being super nice, so I can't get that to work right now. Just send in those columns via your own