]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
- this comment is wrong, the method here returns all mapper entities
authorMike Bayer <mike_mp@zzzcomputing.com>
Sat, 24 Aug 2013 15:30:57 +0000 (11:30 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Sat, 24 Aug 2013 15:32:04 +0000 (11:32 -0400)
- use a simple isinstance() check instead of looking for presence of
"primary_entity" flag, that's a little unclear

lib/sqlalchemy/orm/query.py

index 2e849fba94cda2f864a85b0da7227ca43cef8d2e..201f90ab994ed3d452e442b35eef3283b9a393c3 100644 (file)
@@ -276,11 +276,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):