[sqlalchemy] Re: Declaring a secondaryjoin in many to many relation.

2009-02-02 Thread Piotrek Byzia
'Homologues' seems to work, but no luck with 'Interactions' where I get rid of 'id' and code below returns error on join conditions: What should be ForeignKey and relation in each of this classes? Too bad that there is a declarative model introduced in the tutorial but all more advanced examples

[sqlalchemy] Re: Declaring a secondaryjoin in many to many relation.

2009-02-02 Thread Piotrek Byzia
OK, it seems to work finally :) Thanks to this http://www.sqlalchemy.org/docs/05/reference/ext/declarative.html#configuring-relations On Feb 2, 2:03 pm, Piotrek Byzia piotr.by...@gmail.com wrote: 'Homologues' seems to work, but no luck with 'Interactions' where I get rid of 'id' and code

[sqlalchemy] Re: Declaring a secondaryjoin in many to many relation.

2009-02-01 Thread Michael Bayer
you're using homologues to link Protein_seed to PDB. so the two foreign keys should be between the tables named Proteins_seed and PDB, not Proteins_putative, which seems to be otherwise unmentioned here. On Feb 1, 2009, at 11:57 AM, Piotrek Byzia wrote: Hi, I'm a fresh user of

[sqlalchemy] Re: Declaring a secondaryjoin in many to many relation.

2009-02-01 Thread Piotrek Byzia
My fault, I haven't included Proteins_putative, PDB is just another table.. But anyway, the problem is with definition of many-to-many relaction() in Protein_seed. class Protein_putative(Base): __tablename__ = 'Proteins_putative' id = Column(Integer, primary_key=True) name =

[sqlalchemy] Re: Declaring a secondaryjoin in many to many relation.

2009-02-01 Thread Michael Bayer
remove the secondary argument from proteins_seed to PDB, the homologues table has no relevance to that relation(). On Feb 1, 2009, at 1:56 PM, Piotrek Byzia wrote: My fault, I haven't included Proteins_putative, PDB is just another table.. But anyway, the problem is with definition of

[sqlalchemy] Re: Declaring a secondaryjoin in many to many relation.

2009-02-01 Thread Piotrek Byzia
Michael, Thanks for that hint! However, I still don't know how should I include association table 'homologues' relation :-( I sketched a schema of my DB: http://flickr.com/photos/piotrbyzia/3244490067/ and relevant code is under: http://pastie.org/376811 The similar problem is with

[sqlalchemy] Re: Declaring a secondaryjoin in many to many relation.

2009-02-01 Thread Michael Bayer
On Feb 1, 2009, at 3:24 PM, Piotrek Byzia wrote: Michael, Thanks for that hint! However, I still don't know how should I include association table 'homologues' relation :-( I sketched a schema of my DB: http://flickr.com/photos/piotrbyzia/3244490067/ and relevant code is under: