[Answer]-Fetch data using count function in django

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()

Leave a comment