summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2012-04-24 11:58:14 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2012-04-24 11:58:14 -0400
commit2086728eb5c9d25d7e604fc0fc468d5ce5464122 (patch)
tree9cf49bbbb90684e7311c103dd71bd552a798adfe /lib/sqlalchemy
parentf5c98d5470ba2d7ed42ed6c1298d760eb5765710 (diff)
downloadsqlalchemy-2086728eb5c9d25d7e604fc0fc468d5ce5464122.tar.gz
- [bug] The warning emitted when using
delete-orphan cascade with one-to-many or many-to-many without single-parent=True is now an error. The ORM would fail to function subsequent to this warning in any case. [ticket:2405]
Diffstat (limited to 'lib/sqlalchemy')
-rw-r--r--lib/sqlalchemy/orm/properties.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/sqlalchemy/orm/properties.py b/lib/sqlalchemy/orm/properties.py
index fd64e7b81..79676642c 100644
--- a/lib/sqlalchemy/orm/properties.py
+++ b/lib/sqlalchemy/orm/properties.py
@@ -1064,7 +1064,8 @@ class RelationshipProperty(StrategizedProperty):
if self.cascade.delete_orphan and not self.single_parent \
and (self.direction is MANYTOMANY or self.direction
is MANYTOONE):
- util.warn('On %s, delete-orphan cascade is not supported '
+ raise sa_exc.ArgumentError(
+ 'On %s, delete-orphan cascade is not supported '
'on a many-to-many or many-to-one relationship '
'when single_parent is not set. Set '
'single_parent=True on the relationship().'