[Answer]-How to count objects count that have ForeignKey relationship? 21 December 2023 by thecoderscamp.com 1👍 Exclude blog that has no post, then count. Blog.objects.exclude(post=None).count() 👤falsetru [Answer]-Accessing Django dictionary in Javascript 0👍 You can filter by related model Blog.objects.filter(post__isnull=False).count() 👤nes [Answer]-Determining a Model Has Been Deleted Source:stackexchange.com