Exemplo n.º 1
0
def search(request):
    if request.method == 'POST':  # If the form has been submitted...
        product = str(request.POST['product'])  # look for variable product in POST
        results = DoRequest.findByKeyword(product)  # get the results for the search
        items = XmlParser.processMessage(results)
        return render_to_response('searchResults.html', {'items': items, 'searchTerm': product})
    else:
        return render_to_response('home.html')