Exemplo n.º 1
0
def games_requests(request):
    games_requests = gm.get_game_requests(request.user)
    context = RequestContext(request, {
        'game_requests': games_requests.values(),
        'move_time_cases': gm.move_time_cases
    })
    return render(request, 'game/games.html', context)
Exemplo n.º 2
0
def get_game_requests(request):
    game_requests = gm.get_game_requests(request.user)
    result = map(
        lambda r: dict(id=r.user.id, username=r.user.username,
                       time=r.move_time),
        game_requests.values())
    return HttpResponse(str(result))