remove the "in-flush" check for standalone orphans

Issue #1912 resolved
Mike Bayer repo owner created an issue

It should be possible to persist an object that would otherwise be orphaned using only foreign key settings:

o = Order(user_id=7)
sess.add(o)
sess.commit()

The case where "user_id" is None should be left to referential integrity to handle.

The original rationale for the "Instance XYZ is pending/unflushed/orphan" thing comes from the ancient thread defined at http://thread.gmane.org/gmane.comp.python.sqlalchemy.user/3085 .

Patch attached maintains all behavior specified from that thread, cleans up the "test_cascade.py" and other unit tests, and removes the check for standalone orphans on flush.

This will be for 0.7 since it is a behavioral change.

Comments (4)

  1. Log in to comment