From: Mike Bayer Date: Sun, 18 Aug 2013 20:09:17 +0000 (-0400) Subject: - use newly fixed WeakSequence (#2794) to not have to rely on class name for sorting... X-Git-Tag: rel_0_8_3~60 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=01aeeb96f9230637d49440cc7580f83697318547;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git - use newly fixed WeakSequence (#2794) to not have to rely on class name for sorting in #2779 --- diff --git a/lib/sqlalchemy/orm/mapper.py b/lib/sqlalchemy/orm/mapper.py index e5c9a05c2e..0f9ea1429c 100644 --- a/lib/sqlalchemy/orm/mapper.py +++ b/lib/sqlalchemy/orm/mapper.py @@ -482,7 +482,7 @@ class Mapper(_InspectionAttr): being present.""" # a set of all mappers which inherit from this one. - self._inheriting_mappers = util.WeakSet() + self._inheriting_mappers = util.WeakSequence() if self.inherits: if isinstance(self.inherits, type): @@ -556,7 +556,7 @@ class Mapper(_InspectionAttr): self.polymorphic_map = self.inherits.polymorphic_map self.batch = self.inherits.batch - self.inherits._inheriting_mappers.add(self) + self.inherits._inheriting_mappers.append(self) self.base_mapper = self.inherits.base_mapper self.passive_updates = self.inherits.passive_updates self._all_tables = self.inherits._all_tables @@ -623,7 +623,7 @@ class Mapper(_InspectionAttr): self.batch = self.inherits.batch for mp in self.self_and_descendants: mp.base_mapper = self.inherits.base_mapper - self.inherits._inheriting_mappers.add(self) + self.inherits._inheriting_mappers.append(self) self.passive_updates = self.inherits.passive_updates self._all_tables = self.inherits._all_tables for key, prop in mapper._props.iteritems(): @@ -1798,8 +1798,7 @@ class Mapper(_InspectionAttr): while stack: item = stack.popleft() descendants.append(item) - stack.extend(sorted(item._inheriting_mappers, - key=lambda m: m.class_.__name__)) + stack.extend(item._inheriting_mappers) return util.WeakSequence(descendants) def polymorphic_iterator(self):