[sqlalchemy] Re: Table Inheritance

2010-11-06 Thread Eric Ongerth
Well, not by exactly using SQLAlchemy's provided implementation of joined table inheritance, because it uses a discriminator column that only holds a single value. Of course it is possible to create more complex inheritance structures on your own, just without some of the polymorphic-loading work

[sqlalchemy] Re: InternalError

2010-11-06 Thread Christopher Grebs
Hey, this is just some specific PostgreSQL behaviour. If there's an error in a transaction it closes the transaction and nothing can be done with it anymore. You need to catch such errors and close the session or at least commit to close the transaction. If you that the following queries will

Re: [sqlalchemy] 'list' object has no attribute '_state'

2010-11-06 Thread Michael Bayer
On Nov 6, 2010, at 1:32 AM, pianoman wrote: Hi I feel I have exhausted all the usual options in finding a solution for this problem. I'm using Python 2.5.5, SQLAlchemy 0.4.6, and Elixir 0.5.2. I'm really not sure how much code I should include for this to make any sense to others.

Re: [sqlalchemy] Re: InternalError

2010-11-06 Thread Michael Hipp
On 11/6/2010 12:15 AM, Christopher Grebs wrote: this is just some specific PostgreSQL behaviour. If there's an error in a transaction it closes the transaction and nothing can be done with it anymore. You need to catch such errors and close the session or at least commit to close the

[sqlalchemy] Could not find table 'images' with which to generate a foreign key error in many-to-many relationship

2010-11-06 Thread lavoisier
Hello all. I'm currently working on a Pylons project, and working on a model for organizing images on the site. I have yet to even implement anything relating to its function, since I keep on receiving the following error pertaining to the model: InvalidRequestError: One or more mappers failed to

Re: [sqlalchemy] Read-only transactions

2010-11-06 Thread Yang Zhang
Thanks, Michael. We're now doing something similar to your suggestion: monkey-patching Session.flush() to check len(Session.dirty) == 0. This seems to work OK. We can't rely on read-only DB-level users because we also use sqlite for testing purposes, and we'd like to catch errors there too

Re: [sqlalchemy] Read-only transactions

2010-11-06 Thread Michael Bayer
On Nov 6, 2010, at 2:13 PM, Yang Zhang wrote: Thanks, Michael. We're now doing something similar to your suggestion: monkey-patching Session.flush() to check len(Session.dirty) == 0. This seems to work OK. We can't rely on read-only DB-level users because we also use sqlite for testing

Re: [sqlalchemy] Could not find table 'images' with which to generate a foreign key error in many-to-many relationship

2010-11-06 Thread argentp...@gmail.com
Thank you so much, Michael! It makes sense. I just tried it out, and it works correctly. I should have asked this question sooner. I would have saved myself a lot of wasted effort. On Sat, Nov 6, 2010 at 2:28 PM, Michael Bayer mike...@zzzcomputing.comwrote: On Nov 6, 2010, at 1:26 PM,

[sqlalchemy] Re: Universal way to process inserting or updating values

2010-11-06 Thread Kent
Mike, I made the assumption parameters would always be a dictionary: from sqlalchemy.interfaces import ConnectionProxy class PostgresProxy(ConnectionProxy): Low level connection proxy to change all empty string '' to None, so that postgres and Oracle behave the same for us

Re: [sqlalchemy] Re: Universal way to process inserting or updating values

2010-11-06 Thread Michael Bayer
On Nov 6, 2010, at 3:12 PM, Kent wrote: Mike, I made the assumption parameters would always be a dictionary: from sqlalchemy.interfaces import ConnectionProxy class PostgresProxy(ConnectionProxy): Low level connection proxy to change all empty string '' to None, so that