Re: [sqlalchemy] inheritance with multiple foreign keys to the base table

2015-02-24 Thread Michael Bayer
Christopher Singley ch...@singleys.com wrote: I'm using declared_attr.cascading from sqlalchemy-1.0.0dev to declare a foreign key on a subclass that also needs another separate foreign key reference to the parent table. To let the Mapper know which column to join for the polymorphic

Re: [sqlalchemy] How do we define a relationship in sqlalchemy for a innodb file without actually creating the FK

2015-02-24 Thread Simon King
I'm not sure I understand - the line you've shown doesn't include any joins between Signals and Clips, so I don't know why that error would occur. In general, if you are seeing that error message, then you need to explicitly tell SQLAlchemy the join condition between the 2 tables. This is

Re: [sqlalchemy] How can I know which fields cause IntegrityError when inserting into a table with multiple unique fields?

2015-02-24 Thread Maurice Schleußinger
Merge wont work in my case, because I commit in bulk and also use multiple processes. By the time the commit is triggered (e.g. as soon as there are 1000 new objects to commit) an other process could have committed an object already which triggers an IntegrityError. The same applies for the

[sqlalchemy] inheritance with multiple foreign keys to the base table

2015-02-24 Thread Christopher Singley
I'm using declared_attr.cascading from sqlalchemy-1.0.0dev to declare a foreign key on a subclass that also needs another separate foreign key reference to the parent table. To let the Mapper know which column to join for the polymorphic inheritance relationship, I'm trying to pass an

Re: [sqlalchemy] How do we define a relationship in sqlalchemy for a innodb file without actually creating the FK

2015-02-24 Thread eli rashlin
I'm Sorry Simon - wrong query... This is the query that gives me the error query_obj = engine.query(signals_table.Signals.sig_value, signals_table.Signals.exist_in_frames,

Re: [sqlalchemy] relationship problem

2015-02-24 Thread Julien Cigar
On Thu, Feb 19, 2015 at 11:31:10AM -0500, Michael Bayer wrote: Julien Cigar jci...@ulb.ac.be wrote: On Thu, Feb 19, 2015 at 02:45:43PM +0100, Julien Cigar wrote: Hello, I'm using SQLAlchemy 0.9.8 with PostgreSQL and the reflection feature of SQLAlchemy. I have the following

Re: [sqlalchemy] How do we define a relationship in sqlalchemy for a innodb file without actually creating the FK

2015-02-24 Thread Simon King
What happens if you replace join(clips_table.Clips) with join(signals_table.Signals.clips) ie. telling SQLAlchemy to use the predefined relationship between Signals and Clips as the join condition. On Tue, Feb 24, 2015 at 12:35 PM, eli rashlin eli.rash...@gmail.com wrote: I'm Sorry

Re: [sqlalchemy] inheritance with multiple foreign keys to the base table

2015-02-24 Thread Christopher Singley
Thanks! Working for me now. On Tue, Feb 24, 2015 at 2:31 PM, Michael Bayer mike...@zzzcomputing.com wrote: Christopher Singley ch...@singleys.com wrote: I'm using declared_attr.cascading from sqlalchemy-1.0.0dev to declare a foreign key on a subclass that also needs another separate