On Sun, Jul 11, 2010 at 11:17, chaouche yacine <[email protected]> wrote: > --- On Thu, 7/1/10, Diez B. Roggisch <[email protected]> wrote: > >> > There's one problem : the error I'm getting is not on >> the foreign key constraint it's on the NOT NULL contraint. >> >> This is because SA issues an update to the city, setting >> the country to NULL. You can see that if you'd use my code >> that set the bind's echo property to True. >> >> Now honestly I don't know how to fix this, but this might >> help: >> >> http://www.sqlalchemy.org/docs/05/mappers.html#using-passive-deletes >> >> Passing passive_deletes=True to the OneToMany-relation >> might solve the issue of trying to update child-relations. >> >> Diez > > Should I consider this a bug and open a ticket for it ?
passive_deletes="all" should do what you want (seems to be only available in SA 0.6+). I have never used it myself and I must admit I am quite astonished as to how hard it was (how deep in the docs I had to dig) to find how to support this (IMO) trivial setup. If that does not work for you, please ask on SQLAlchemy's mailing list, or open a bug in their tracker, as this problem is not specific to Elixir. Hope it helps, -- Gaƫtan de Menten -- You received this message because you are subscribed to the Google Groups "SQLElixir" 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/sqlelixir?hl=en.
