Instead of implementing modelManager
you can set the queryset on the ListView
class as:
class IndexView(generic.ListView):
model = Question
template_name = "qa_forum/index.html"
context_object_name = 'question_list'
paginate_by = 25
queryset = Question.objects.filter(pub_date__lte=timezone.now(),
is_active=True).order_by('-pub_date')
If you want to go by modelManager
method, you can set queryset as
class IndexView(generic.ListView):
#if you have set manger as active_objects in Question model
queryset = Question.active_objects.filter()