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

Method identity_key_from_primary_key

lib/sqlalchemy/orm/mapper.py:3488–3503  ·  view source on GitHub ↗

Return an identity-map key for use in storing/retrieving an item from an identity map. :param primary_key: A list of values indicating the identifier.

(
        self,
        primary_key: Tuple[Any, ...],
        identity_token: Optional[Any] = None,
    )

Source from the content-addressed store, hash-verified

3486 )
3487
3488 def identity_key_from_primary_key(
3489 self,
3490 primary_key: Tuple[Any, ...],
3491 identity_token: Optional[Any] = None,
3492 ) -> _IdentityKeyType[_O]:
3493 """Return an identity-map key for use in storing/retrieving an
3494 item from an identity map.
3495
3496 :param primary_key: A list of values indicating the identifier.
3497
3498 """
3499 return (
3500 self._identity_class,
3501 tuple(primary_key),
3502 identity_token,
3503 )
3504
3505 def identity_key_from_instance(self, instance: _O) -> _IdentityKeyType[_O]:
3506 """Return the identity key for the given instance, based on

Callers 5

identity_keyFunction · 0.80
_identity_lookupMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected