MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / _all_mappers

Method _all_mappers

lib/sqlalchemy/orm/util.py:1456–1471  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1454 )
1455
1456 def _all_mappers(self) -> Iterator[Mapper[Any]]:
1457 if self.entity:
1458 yield from self.entity.mapper.self_and_descendants
1459 else:
1460 assert self.root_entity
1461 stack = list(self.root_entity.__subclasses__())
1462 while stack:
1463 subclass = stack.pop(0)
1464 ent = cast(
1465 "_InternalEntityType[Any]",
1466 inspection.inspect(subclass, raiseerr=False),
1467 )
1468 if ent:
1469 yield from ent.mapper.self_and_descendants
1470 else:
1471 stack.extend(subclass.__subclasses__())
1472
1473 def _should_include(self, compile_state: _ORMCompileState) -> bool:
1474 if (

Callers 1

get_global_criteriaMethod · 0.95

Calls 3

castFunction · 0.50
popMethod · 0.45
extendMethod · 0.45

Tested by

no test coverage detected