MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / _validate_polymorphic_identity

Method _validate_polymorphic_identity

lib/sqlalchemy/orm/mapper.py:1932–1943  ·  view source on GitHub ↗
(mapper, state, dict_)

Source from the content-addressed store, hash-verified

1930 self._polymorphic_attr_key = polymorphic_key
1931
1932 def _validate_polymorphic_identity(mapper, state, dict_):
1933 if (
1934 polymorphic_key in dict_
1935 and dict_[polymorphic_key]
1936 not in mapper._acceptable_polymorphic_identities
1937 ):
1938 util.warn_limited(
1939 "Flushing object %s with "
1940 "incompatible polymorphic identity %r; the "
1941 "object may not refresh and/or load correctly",
1942 (state_str(state), dict_[polymorphic_key]),
1943 )
1944
1945 self._set_polymorphic_identity = _set_polymorphic_identity
1946 self._validate_polymorphic_identity = (

Callers 1

Calls 1

state_strFunction · 0.85

Tested by

no test coverage detected