def search(request): if request.method == 'POST': form = SearchForm(request.POST) if form.is_valid(): return HttpResponseRedirect('/') else: form = SearchForm() extra = dict(form=form) return render_to_response('foundry/search.html', extra, context_instance=RequestContext(request))
def search(request): if request.method == 'POST': form = SearchForm(request.POST) if form.is_valid(): param = urllib.quote(form.cleaned_data['search_term']) return HttpResponseRedirect( reverse('search-results') + '?search_term=' + param ) else: form = SearchForm() extra = dict(form=form) return render_to_response('foundry/search.html', extra, context_instance=RequestContext(request))