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: http://pastie.org/376811 > > The similar problem is with Interactions table - how should I define > many-to-many relation there? > > SQLA seems pretty mature, but to be honest, I struggle to find one > complete example to use as a boiler plate... you should map your classes just like your tables are linked. Proteins_seed has a "putative" relation that joins to Proteins_putative via relation(Protein_putative, secondary=homologues), Proteins_putative has a relation() to Interaction, which then has a further relation() to Proteins_putative again, etc. Every table in your picture gets a mapped class except for homologues, every line gets a relation() except for the lines in and out of homologues which is encompassed by a single relation(). --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to sqlalchemy@googlegroups.com To unsubscribe from this group, send email to sqlalchemy+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en -~----------~----~----~----~------~----~------~--~---