def advanced_search(request): keywords = request.POST.get("keywords") daterange = request.POST.get("daterange") categories = request.POST.getlist("categories[]") result = search_by_all(keywords=keywords, ctg=categories, daterange=daterange) return JsonResponse(result, safe=False)
def post(self, request, *args, **kwargs): keywords = request.POST.get('keywords') categories = request.POST.getlist('categories') daterange = request.POST.get('daterange') results = search_by_all(keywords=keywords, ctg=categories, daterange=daterange) return render(request, 'newsfocus/results.html', {'results': results})
def ordinary_search(request): keywords = request.POST.get("keywords") result = search_by_all(keywords=keywords) return JsonResponse(result, safe=False)