MCPcopy Create free account
hub / github.com/sqlalchemy/sqlalchemy / contains_mapper

Method contains_mapper

lib/sqlalchemy/orm/path_registry.py:272–278  ·  view source on GitHub ↗
(self, mapper: Mapper[Any])

Source from the content-addressed store, hash-verified

270 yield odd_path[i], even_path[i + 1]
271
272 def contains_mapper(self, mapper: Mapper[Any]) -> bool:
273 _m_path = cast(_OddPathRepresentation, self.path)
274 for path_mapper in [_m_path[i] for i in range(0, len(_m_path), 2)]:
275 if path_mapper.mapper.isa(mapper):
276 return True
277 else:
278 return False
279
280 def contains(self, attributes: Dict[Any, Any], key: Any) -> bool:
281 return (key, self.path) in attributes

Callers 3

_setup_for_recursionMethod · 0.80
setup_queryMethod · 0.80
test_contains_mapperMethod · 0.80

Calls 2

castFunction · 0.85
isaMethod · 0.80

Tested by 1

test_contains_mapperMethod · 0.64