From: Mike Bayer Date: Fri, 21 Mar 2008 16:43:51 +0000 (+0000) Subject: - adjusted the definition of "self-referential" to be X-Git-Tag: rel_0_4_5~65 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=55192da8993bb89b637312fba319a412eb6ceabd;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git - adjusted the definition of "self-referential" to be any two mappers with a common parent (this affects whether or not aliased=True is required when joining with Query). --- diff --git a/CHANGES b/CHANGES index d555062abd..002f0fa5d3 100644 --- a/CHANGES +++ b/CHANGES @@ -20,6 +20,11 @@ CHANGES - Session.execute can now find binds from metadata + - adjusted the definition of "self-referential" to be + any two mappers with a common parent (this affects + whether or not aliased=True is required when joining + with Query). + - assorted "cascade deletes" fixes: - Fixed "cascade delete" operation of dynamic relations, which had only been implemented for diff --git a/lib/sqlalchemy/orm/properties.py b/lib/sqlalchemy/orm/properties.py index e34c725ffe..13ed83bc94 100644 --- a/lib/sqlalchemy/orm/properties.py +++ b/lib/sqlalchemy/orm/properties.py @@ -759,7 +759,7 @@ class PropertyLoader(StrategizedProperty): return self.parent.mapped_table is self.target or self.parent.select_table is self.target def _is_self_referential(self): - return self.mapper.isa(self.parent) + return self.mapper.common_parent(self.parent) def primary_join_against(self, mapper, selectable=None, toselectable=None): return self.__cached_join_against(mapper, selectable, toselectable, True, False)