From: Mike Bayer Date: Sat, 24 Aug 2013 15:30:57 +0000 (-0400) Subject: - this comment is wrong, the method here returns all mapper entities X-Git-Tag: rel_0_8_3~44 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f8061236b8e74596fcb372149b76b9caa476e5b5;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git - this comment is wrong, the method here returns all mapper entities - use a simple isinstance() check instead of looking for presence of "primary_entity" flag, that's a little unclear --- diff --git a/lib/sqlalchemy/orm/query.py b/lib/sqlalchemy/orm/query.py index f5925d96c4..8f835cd30e 100644 --- a/lib/sqlalchemy/orm/query.py +++ b/lib/sqlalchemy/orm/query.py @@ -299,11 +299,8 @@ class Query(object): @property def _mapper_entities(self): - # TODO: this is wrong, its hardcoded to "primary entity" when - # for the case of __all_equivs() it should not be - # the name of this accessor is wrong too for ent in self._entities: - if hasattr(ent, 'primary_entity'): + if isinstance(ent, _MapperEntity): yield ent def _joinpoint_zero(self):