- changed title to remove the "in-flush" check for standalone orphans
remove the "in-flush" check for standalone orphans
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)
-
reporter -
reporter - changed status to resolved
-
reporter Adding to this c25412d90a1ad13fd09618aa5f21a0d109251002 that self-referential "orphan cascade" is entirely fine.
-
reporter - removed milestone
Removing milestone: 0.7.0 (automated comment)
- Log in to comment