[Answered ]-Django filter by size of many-to-many relationship

2👍

If I understood correctly, it is achievable using annotations. Since I am not aware of your models, it would look something like this:

PhotoSet.objects.values("id").annotate(Count("tags"))

Refer this

Leave a comment