I have the following model:

```
...
from django.contrib.auth.models import User

class TaxonomyNode(models.Model):
    node_id = models.CharField(max_length=20)
    name = models.CharField(max_length=100)
    ...

class Annotation(models.Model):
    ...
    taxonomy_node = models.ForeignKey(TaxonomyNode, blank=True, null=True)

class Vote(models.Model):
    created_by = models.ForeignKey(User, related_name='votes', null=True, on_delete=models.SET_NULL)
    vote = models.FloatField()
    annotation = models.ForeignKey(Annotation, related_name='votes')
    ...

```

In the app, a `User` can produce `Vote` for an `Annotation` instance.
A `User` **can vote only once** for an `Annotation` instance.
I want to get a query set with the `TaxonomyNode` which a `User` can still annotate a least one of its `Annotation`. For now, I do it that way:

```
def user_can_annotate(node_id, user):
    if Annotation.objects.filter(node_id=node_id).exclude(votes__created_by=user).count() == 0:
        return False
    else:
        return True

def get_categories_to_validate(user):
    """
    Returns a query set with the TaxonomyNode which have Annotation that can be validated by a user
    """
    nodes = TaxonomyNode.objects.all()
    nodes_to_keep = [node.node_id for node in nodes if self.user_can_annotate(node.node_id, user)]
    return nodes.filter(node_id__in=nodes_to_keep)

categories_to_validate = get_category_to_validate(<user instance>)

```

I guess there is a way to do it in one query, that would speed up the process quite a lot. In brief, I want to exclude from the `TaxonomyNode` set, all the nodes that have **all** their annotations already voted once by the user.

Any idea of how I could do it? With django ORM or in SQL?
I have Django version 1.10.6