[Answer]-Django QuerySet to return unique objects in ManyToMany fields

1👍

Just use backward relationship

Author.objects.filter(book__published_year=2008).all()

From Django docs

Reverse m2m queries are supported (i.e., starting at the table that
doesn’t have a ManyToManyField):

👤levi

Leave a comment