[Solved]-Django query filter by number of ManyToMany objects 1 March 2024 by thecoderscamp.com 17👍 ✅ Event.objects.annotate(c=Count('userprofile')).filter(c__lt=4) 👤Yuji 'Tomita' Tomita Django verbose request logging Source:stackexchange.com