'Return the identity key for the given instance, based on
its primary key attributes.
If the instance\'s state is expired, calling this method
will result in a database check to see if the object has been deleted.
If the row no longer exists,
:class:`~sqlalchemy.orm.exc.ObjectDeletedError` is raised.
This value is typically also found on the instance state under the
attribute name `key`.'

def identity_key_from_instance(self, instance):

    return self.identity_key_from_primary_key(self.primary_key_from_instance(instance))
