def forums(request):
 qs = Forum.objects.filter(is_listed=True)
 qs = qs.select_related('last_post', 'last_post__author')
 qs = qs.extra(select={'thread_count': 'SELECT COUNT(*) FROM forums_thread WHERE forums_thread.forum_id = forums_forum.id'})
 forums_ = [f for f in qs if f.allows_viewing_by(request.user)]
 return render(request, 'forums/forums.html', {'forums': paginate(request, forums_)})

def forums ( request ) : qs = Forum . objects . filter ( is_listed = True ) qs = qs . select_related ( 'last_post' , 'last_post__author' ) qs = qs . extra ( select = { 'thread_count' : 'SELECT COUNT(*) FROM forums_thread WHERE forums_thread.forum_id = forums_forum.id' } ) forums_ = [ f for f in qs if f . allows_viewing_by ( request . user ) ] return render ( request , 'forums/forums.html' , { 'forums' : paginate ( request , forums_ ) } )
view all the forums .