コード例 #1
0
ファイル: views.py プロジェクト: pshevade/nanoproblems
def add_comment_to_solution(request, problem_id, solution_id):
    print "inside add_comment_to_solution"
    solution = logic.get_solution(solution_id)
    if request.method == "POST":
        print "request method is post!"
        logic.new_comment_solution(request, solution)
    print "sending to show_solution from add_comment_to_solution"
    return HttpResponseRedirect("/problems/" + str(problem_id) + "/show_solution/" + str(solution_id))
コード例 #2
0
ファイル: views.py プロジェクト: pshevade/nanoproblems
def new_comment_solution(request, problem_id, solution_id):
    print "inside new_comment_solution."
    print "Here is the POST: ", request.POST.get("content")
    print "Here is the data: ", json.loads(request.body)["content"]
    print "Is is ajax? ", request.is_ajax()
    solution = logic.get_solution(solution_id)
    if request.method == "POST":
        logic.new_comment_solution(request, solution)
    return HttpResponse(status=200)