Exemplo n.º 1
0
def search(request):
    if request.method == "POST":
        val_search = request.POST["search"]
        val_type = request.POST["type"]
        script = Script()
        scripts = []
        if val_type == "title":
            scripts = script.getTitles(val_search)
        else:
            scripts = script.getAuthors(val_search)
        return render_to_response("scripts.html", {"scripts": scripts}, context_instance=RequestContext(request))