Actually I see why that's happening now. Because of the inheritance (I'm assuming), sqlalchemy is creating a Sport record as a "parent" of every SourceSport created, and it's also creating a Competition record as a parent of every SourceCompetition created.
Just looking back at my original post, in case I've caused confusion, my description of the class connection was wrong, for both Sport and Competition, and SourceSport and SourceCompetition respectively, they're 1-to-many relationships, not 1-to-1 as I'd indicated, Sport 1----* SourceSport Competition 1----* SourceCompetition The class structure was fine, but yeah Sport "has many" SourceSport's, and Competition has many SourceCompetition's. (Same as Source has many SourceSports, and also has many SourceCompetitions). Is this the default behaviour with this inheritance setup? I can't find any clear description of this in the documentation - http://docs.sqlalchemy.org/en/latest/orm/inheritance.html#joined-table-inheritance Obviously this is completely unwanted, and incorrect for my setup. The "parent" Sport for a SourceSport isn't a new item in the dB, it's the sport that's already created and referred to by SourceSport.sport. -- SQLAlchemy - The Python SQL Toolkit and Object Relational Mapper http://www.sqlalchemy.org/ To post example code, please provide an MCVE: Minimal, Complete, and Verifiable Example. See http://stackoverflow.com/help/mcve for a full description. --- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/sqlalchemy. For more options, visit https://groups.google.com/d/optout.
