summaryrefslogtreecommitdiff
path: root/website
diff options
context:
space:
mode:
authorJayaram Pai2013-12-09 12:47:18 +0530
committerJayaram Pai2013-12-09 12:47:18 +0530
commit0dd964ec05401809a408ab55d5517d3b2fba3a85 (patch)
tree805c74ea457c551cea557be39d16fb91d42cea9f /website
parentb596364cf3f871887cce519291b684341cc5c014 (diff)
downloadFOSSEE-Forum-0dd964ec05401809a408ab55d5517d3b2fba3a85.tar.gz
FOSSEE-Forum-0dd964ec05401809a408ab55d5517d3b2fba3a85.tar.bz2
FOSSEE-Forum-0dd964ec05401809a408ab55d5517d3b2fba3a85.zip
reply edit with no ajax
Diffstat (limited to 'website')
-rw-r--r--website/urls.py1
-rw-r--r--website/views.py16
2 files changed, 17 insertions, 0 deletions
diff --git a/website/urls.py b/website/urls.py
index 774acb9..c385ea0 100644
--- a/website/urls.py
+++ b/website/urls.py
@@ -14,4 +14,5 @@ urlpatterns = patterns('',
url(r'^ajax-tutorials/$', 'website.views.ajax_tutorials', name='ajax_tutorials'),
url(r'^ajax-duration/$', 'website.views.ajax_duration', name='ajax_duration'),
url(r'^ajax-question-update/$', 'website.views.ajax_question_update', name='ajax_question_update'),
+ url(r'^ajax-similar-questions/$', 'website.views.ajax_similar_questions', name='ajax_similar_questions'),
)
diff --git a/website/views.py b/website/views.py
index e18a000..538d90e 100644
--- a/website/views.py
+++ b/website/views.py
@@ -155,3 +155,19 @@ def ajax_question_update(request):
question.body = body
question.save()
return HttpResponse("saved")
+
+@csrf_exempt
+def ajax_similar_questions(request):
+ if request.method == 'POST':
+ category = request.POST['category']
+ tutorial = request.POST['tutorial']
+ minute_range = request.POST['minute_range']
+ second_range = request.POST['second_range']
+
+ # add more filtering when the forum grows
+ questions = Question.objects.filter(category=category).filter(tutorial=tutorial)
+ context = {
+ 'questions': questions
+ }
+ return render(request, 'website/templates/ajax-similar-questions.html', context);
+