Exemple #1
0
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)
Exemple #2
0
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)