summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/mapping/mapper.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2006-03-06 01:07:48 +0000
committerMike Bayer <mike_mp@zzzcomputing.com>2006-03-06 01:07:48 +0000
commit02b9fa23ce4c4f6fcd79111459e14864f334d1f1 (patch)
treec640a1d27fee176fbb9e727bd3f6ad10e8009b0a /lib/sqlalchemy/mapping/mapper.py
parentd54b5eba74bd5569fa3c89ba730957177c6b11f6 (diff)
downloadsqlalchemy-02b9fa23ce4c4f6fcd79111459e14864f334d1f1.tar.gz
delete tables in an inheritance rel. requires them in reverse
Diffstat (limited to 'lib/sqlalchemy/mapping/mapper.py')
-rw-r--r--lib/sqlalchemy/mapping/mapper.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/sqlalchemy/mapping/mapper.py b/lib/sqlalchemy/mapping/mapper.py
index 8239df99c..6a7eb9659 100644
--- a/lib/sqlalchemy/mapping/mapper.py
+++ b/lib/sqlalchemy/mapping/mapper.py
@@ -636,7 +636,9 @@ class Mapper(object):
def delete_obj(self, objects, uow):
"""called by a UnitOfWork object to delete objects, which involves a
DELETE statement for each table used by this mapper, for each object in the list."""
- for table in self.tables:
+ l = list(self.tables)
+ l.reverse()
+ for table in l:
if not self._has_pks(table):
continue
delete = []