From: Mike Bayer Date: Mon, 6 Mar 2006 01:07:48 +0000 (+0000) Subject: delete tables in an inheritance rel. requires them in reverse X-Git-Tag: rel_0_1_4~39 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=02b9fa23ce4c4f6fcd79111459e14864f334d1f1;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git delete tables in an inheritance rel. requires them in reverse --- diff --git a/lib/sqlalchemy/mapping/mapper.py b/lib/sqlalchemy/mapping/mapper.py index 8239df99ce..6a7eb9659d 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 = []