MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / contains_mapper

Method contains_mapper

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

Source from the content-addressed store, hash-verified

236 yield odd_path[i], even_path[i + 1]
237
238 def contains_mapper(self, mapper: Mapper[Any]) -> bool:
239 _m_path = cast(_OddPathRepresentation, self.path)
240 for path_mapper in [_m_path[i] for i in range(0, len(_m_path), 2)]:
241 if path_mapper.mapper.isa(mapper):
242 return True
243 else:
244 return False
245
246 def contains(self, attributes: Dict[Any, Any], key: Any) -> bool:
247 return (key, self.path) in attributes

Callers 3

_setup_for_recursionMethod · 0.80
setup_queryMethod · 0.80
test_contains_mapperMethod · 0.80

Calls 2

isaMethod · 0.80
castFunction · 0.50

Tested by 1

test_contains_mapperMethod · 0.64