1👍
✅
The count()
method does not take any arguments. You can filter the queryset first, then use count. For example:
published_count = Book.objects.filter(published=True).count()
Source:stackexchange.com