Skip to content

Commit

Permalink
changed view code to use render over render_to_response
Browse files Browse the repository at this point in the history
  • Loading branch information
brosner committed Jan 31, 2013
1 parent abe89df commit d227f01
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions aiteo/views.py
Original file line number Original file line Diff line number Diff line change
@@ -1,8 +1,7 @@
from django.conf import settings from django.conf import settings
from django.http import Http404, HttpResponse, HttpResponseRedirect from django.http import Http404, HttpResponse, HttpResponseRedirect
from django.http import HttpResponseNotAllowed, HttpResponseForbidden from django.http import HttpResponseNotAllowed, HttpResponseForbidden
from django.template import RequestContext from django.shortcuts import get_object_or_404, render
from django.shortcuts import get_object_or_404, render_to_response
from django.utils.importlib import import_module from django.utils.importlib import import_module


from django.contrib.auth.decorators import login_required from django.contrib.auth.decorators import login_required
Expand All @@ -21,9 +20,7 @@ def question_list(request, **kwargs):
ctx = { ctx = {
"questions": questions, "questions": questions,
} }

return render(request, "aiteo/question_list.html", ctx)
ctx = RequestContext(request, ctx)
return render_to_response("aiteo/question_list.html", ctx)




@login_required @login_required
Expand All @@ -42,9 +39,7 @@ def question_create(request, **kwargs):
ctx = { ctx = {
"form": form, "form": form,
} }

return render(request, "aiteo/question_create.html", ctx)
ctx = RequestContext(request, ctx)
return render_to_response("aiteo/question_create.html", ctx)




def question_detail(request, question_id, **kwargs): def question_detail(request, question_id, **kwargs):
Expand Down Expand Up @@ -80,9 +75,7 @@ def question_detail(request, question_id, **kwargs):
"responses": responses, "responses": responses,
"add_response_form": add_response_form, "add_response_form": add_response_form,
} }

return render(request, "aiteo/question_detail.html", ctx)
ctx = RequestContext(request, ctx)
return render_to_response("aiteo/question_detail.html", ctx)




def mark_accepted(request, question_id, response_id, **kwargs): def mark_accepted(request, question_id, response_id, **kwargs):
Expand Down

0 comments on commit d227f01

Please sign in to comment.