My code is like this: I custom my context and want to access my query set in template
class GetStudentQueryHandler(ListView):
template_name = 'client.html'
paginate_by = STUDENT_PER_PAGE
context_object_name = 'studentinfo'
def get_context_data(self, **kwargs):
context = super(GetStudentQueryHandler, self).get_context_data(**kwargs)
context['can_show_distribute'] = self.request.user.has_perm('can_show_distribute_page')
context['form'] = QueryStudentForm
return context
def get_queryset(self):
The question is : how to access the queryset returned by the get_queryset method in templates? I know I can access the custom attributes like studentinfo.can_show_distribute, how to access the query data?