MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / _canload

Method _canload

lib/sqlalchemy/orm/mapper.py:3336–3343  ·  view source on GitHub ↗
(
        self, state: InstanceState[Any], allow_subtypes: bool
    )

Source from the content-addressed store, hash-verified

3334 )
3335
3336 def _canload(
3337 self, state: InstanceState[Any], allow_subtypes: bool
3338 ) -> bool:
3339 s = self.primary_mapper()
3340 if self.polymorphic_on is not None or allow_subtypes:
3341 return _state_mapper(state).isa(s)
3342 else:
3343 return _state_mapper(state) is s
3344
3345 def isa(self, other: Mapper[Any]) -> bool:
3346 """Return True if the this mapper inherits from the given mapper."""

Callers 1

_verify_canloadMethod · 0.80

Calls 3

primary_mapperMethod · 0.95
_state_mapperFunction · 0.85
isaMethod · 0.80

Tested by

no test coverage detected