On Mar 16, 9:50 pm, Michael Bayer <[EMAIL PROTECTED]> wrote:
> oh, this is easy.  you have a circular insert relationship between
> "label" and "release_line", which you can see in the sort there (the
> "cycles:") as well as evidenced by the fact that you have a
> "use_alter" needed in order to create the foreign keys on those two
> tables.  add "post_update=True" to one of the relationships which
> will break that particular cycle by using a second UPDATE statement,
> and youre in.

Brilliant - that did it. Thanks a lot.

Is there any way that SA could have raised an error in this situation?
I think this would be very tricky for someone unfamiliar with the SA
internals to debug, particularly as it doesn't occur every time. Are
there situations where it is reasonable to have cycles without
post_update?

I had assumed that post_update was only necessary when you are
inserting two rows that are mutually dependent, but in this case I
wasn't inserting either a ReleaseLine or a Label. I suppose
post_update can actually have a knock-on affect across the whole
dependency graph.

Anyway, thanks a lot again for your help,

Simon


--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to