src/risclog/sqlalchemy/cache.py
def _get_attribute_index(self, model, attributes):
        """
        Return a dictionary containing model attribute values as keys and a
        list of matching instances as values.
        """
        model_indices = self._get_model_indices(model)
        attribute_key = tuple(sorted(attributes))

        if attribute_key not in model_indices:
            model_cache = self._get_model_cache(model)
            indexed_instances = {}
            for instance in model_cache:
                instance_key = self._object_instance_key(
                    instance, attribute_key
                )
                cache = indexed_instances.setdefault(instance_key, [])
                cache.append(instance)
            model_indices[attribute_key] = indexed_instances

        return model_indices[attribute_key]

        Return a dictionary containing model attribute values as keys and a
        list of matching instances as values.
        
Return a dictionary containing model attribute values as keys and a
list of matching instances as values.
Return a dictionary containing model attribute values as keys and a list of matching instances as values .
def _get_attribute_index(self, model, attributes):
        model_indices = self._get_model_indices(model)
        attribute_key = tuple(sorted(attributes))
        if attribute_key not in model_indices:
            model_cache = self._get_model_cache(model)
            indexed_instances = {}
            for instance in model_cache:
                instance_key = self._object_instance_key(
                    instance, attribute_key
                )
                cache = indexed_instances.setdefault(instance_key, [])
                cache.append(instance)
            model_indices[attribute_key] = indexed_instances
        return model_indices[attribute_key]
def _get_attribute_index ( self , model , attributes ) : model_indices = self . _get_model_indices ( model ) attribute_key = tuple ( sorted ( attributes ) ) if attribute_key not in model_indices : model_cache = self . _get_model_cache ( model ) indexed_instances = { } for instance in model_cache : instance_key = self . _object_instance_key ( instance , attribute_key ) cache = indexed_instances . setdefault ( instance_key , [ ] ) cache . append ( instance ) model_indices [ attribute_key ] = indexed_instances return model_indices [ attribute_key ]
Return a dictionary containing model attribute values as keys and a
list of matching instances as values.
Return a dictionary containing model attribute values as keys and a list of matching instances as values .
"""
        Return a dictionary containing model attribute values as keys and a
        list of matching instances as values.
        """
self
model
attributes