def list_challenges(request): challenges = Challenge.objects.all() solved = request.session.get('solved', []) points = Challenge.total_points(solved) context = { 'challenges': challenges, 'solved': set(solved), 'points': points } return render(request, 'challenges/list.html', context)