Re: [sqlalchemy] dynamic_loader

2010-01-25 Thread werner
On 24/01/2010 16:57, werner wrote: ... Next thing is to make _get_translation reusable for different tables. I got it down to this: def _do_translation(bInstance, tTable, fCrit, cLang, dLang): try: x =

RE: [sqlalchemy] dynamic_loader

2010-01-25 Thread King Simon-NFHD78
-Original Message- From: sqlalchemy@googlegroups.com [mailto:sqlalch...@googlegroups.com] On Behalf Of werner Sent: 25 January 2010 13:37 To: sqlalchemy@googlegroups.com Subject: Re: [sqlalchemy] dynamic_loader On 24/01/2010 16:57, werner wrote: ... Next thing is to make

[sqlalchemy] Problem using concrete inheritance with migrate

2010-01-25 Thread Todd Blanchard
I have this definition in my upgrade script using migrate meta = MetaData(migrate_engine) DeclarativeBase = declarative_base(metadata=meta) maker = sessionmaker(autoflush=True, autocommit=False, extension=ZopeTransactionExtension()) DBSession = scoped_session(maker)

Re: [sqlalchemy] dynamic_loader

2010-01-25 Thread werner
Simon, On 25/01/2010 15:18, King Simon-NFHD78 wrote: ... I hope that helps, Yes, that did help a lot. This is my custom property class. class TranslationProperty(object): Returns a query enabled property def __init__(self, tTable=None, fCol=None, cLang=None, dLang=None):

Re: [sqlalchemy] Problem using concrete inheritance with migrate

2010-01-25 Thread Michael Bayer
Todd Blanchard wrote: I have this definition in my upgrade script using migrate meta = MetaData(migrate_engine) DeclarativeBase = declarative_base(metadata=meta) maker = sessionmaker(autoflush=True, autocommit=False, extension=ZopeTransactionExtension()) DBSession =

[sqlalchemy] Error handling in SQLAlchemy

2010-01-25 Thread Boda Cydo
Hello all! I have a question about handling errors in SQLAlchemy. Before I used SQLAlchemy I used to rigorously check for all errors when executing queries, like: status = db.query(INSERT INTO users ...) if !status: handle_insert_error() But now when I have switched to SQLAlchemy I write

Re: [sqlalchemy] Problem using concrete inheritance with migrate

2010-01-25 Thread Todd Blanchard
Ugh. Then I just don't get the point - the only reason to use inheritance is to avoid defining all the fields twice (and I have a bunch of methods - but still). I might as well stick with the class decorators approach (which is working really well for me). On Jan 25, 2010, at 1:10 PM,

Re: [sqlalchemy] Problem using concrete inheritance with migrate

2010-01-25 Thread Michael Bayer
On Jan 25, 2010, at 9:13 PM, Todd Blanchard wrote: Ugh. Then I just don't get the point - the only reason to use inheritance is to avoid defining all the fields twice (and I have a bunch of methods - but still). I might as well stick with the class decorators approach (which is working

[sqlalchemy] Re: in_() with composite primary key

2010-01-25 Thread jpeck
On Jan 25, 3:08 pm, Michael Bayer mike...@zzzcomputing.com wrote: jpeck wrote: Depending on your database, you may have a function-style row constructor that does what you want. For example, PostgreSQL treats (a, b) and ROW(a, b) as equivalent. If this works for you, then I think you