Hi, I have a problem that is essentially identical to this: https://groups.google.com/forum/#!searchin/sqlalchemy/association$20table$20duplicate/sqlalchemy/2myGWqEg8LY/lCBB5q4F0PIJ
However, I'm not sure how to proceed. I understand that I can simply check to see if a child exists before adding it in order to avoid an IntegrityError. However, I still want the link between parent and child to be created in the association table: 1 if child doesn't exist: 2 create new child 3 append child to parent's list of children (via association table) 4 else if child exists: 5 retrieve extant child 6 append child to parent's list of children (via association table) Since this is handled automatically by SQLAlchemy, I have no idea how to go about doing step #6. The relationship is defined using a backref. MySQL is Percona 5.6.22-71.0. SQLAlchemy version is 0.9.8. Any help would be greatly appreciated. Thanks, David -- 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 sqlalchemy+unsubscr...@googlegroups.com. To post to this group, send email to sqlalchemy@googlegroups.com. Visit this group at http://groups.google.com/group/sqlalchemy. For more options, visit https://groups.google.com/d/optout.