diff options
author | ashwinishinde | 2015-05-14 11:35:08 +0530 |
---|---|---|
committer | ashwinishinde | 2015-05-14 11:35:08 +0530 |
commit | e68d57dba6f9193d75c48d218dd98c7592e776ee (patch) | |
tree | 570d2008ca4e31247f1eb04bc339508cd628a994 /website | |
parent | 0e3fdb61376f2037a7f0745bc363b946eafd5517 (diff) | |
download | FOSSEE-Forum-e68d57dba6f9193d75c48d218dd98c7592e776ee.tar.gz FOSSEE-Forum-e68d57dba6f9193d75c48d218dd98c7592e776ee.tar.bz2 FOSSEE-Forum-e68d57dba6f9193d75c48d218dd98c7592e776ee.zip |
Subject: Search By Keyword
Description:
1)solved problem in filter.
Diffstat (limited to 'website')
-rw-r--r-- | website/views.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/website/views.py b/website/views.py index 516c7d4..603a4c7 100644 --- a/website/views.py +++ b/website/views.py @@ -21,7 +21,7 @@ from django.db.models import Count admins = ( - 9, 4376, 4915, 14595, 12329, 22467, 5518, 30705 + 9, 4376, 4915, 14595, 12329, 22467, 5518, 30705 ) categories = FossCategory.objects.order_by('name') @@ -497,10 +497,14 @@ def ajax_notification_remove(request): def ajax_keyword_search(request): if request.method == "POST": key = request.POST['key'] - questions = Question.objects.filter(title__icontains=key) + + questions = Question.objects.filter(title__contains=key) + context = { 'questions': questions } + + return render(request, 'website/templates/ajax-keyword-search.html', context) @csrf_exempt |