theres a flag on relation() called post_update which will break the cycle between two mutually dependent foreign keys. check the API docs for it, put it on the relation() that represents many-to-one to save on UPDATE statements.
[email protected] wrote: > > Hi all, > > I'm working with a database which contains 2 tables with mutual > foreign keys. > I used sqlAlchemy to write a populator for it (how easy!), but I have > problems changing mysql engine from isam to innoDb. Mysql is now > actively checking for foreign key integrity, so that when I try to add > the reflected classes a and b: > > session.add(a) > session.add(b) > > i receive an error on the first line because the FK is missing on the > other table. > > How can I do this with sqlAlchemy? > > Cheers, > Davide > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en -~----------~----~----~----~------~----~------~--~---
