我是干草堆的新手。我已经成功完成了本教程:http://django-haystack.readthedocs.org/en/latest/tutorial.html
我现在如何在我的视图中获得queryresultset
的{{1}}?
答案 0 :(得分:0)
def food_log(request):
query=request.GET.get('q','')
form=SearchForm({'q': query })
results = form.search()
print results
context = {
'form':form,
'query':query,
}
return render(request, 'log.html', context)