def difference(resources, other_resources, key):
    """Compare using key and return entries from resources which are not present in other_resources"""
    other_resources_keys = [
        getattr(other_resource, key, None) for other_resource in other_resources
    ]
    return [
        resource
        for resource in resources
        if getattr(resource, key, None) not in other_resources_keys
    ]