def search(request):
    query_string = ''
    found_snipts = None
    if ('q' in request.GET) and request.GET['q'].strip():
        query_string = request.GET['q']
        entry_query = get_query(query_string, ['code', 'description', 'tags',])
        snipts = Snippet.objects.filter(entry_query).filter(Q(public=1) | Q(user=request.user.id)).order_by('-created')
        disable_wrap = request.session.get('disable_wrap')
        disable_message = request.session.get('disable_message')
        snipts_count = snipts.count()
    search = True
    return render_to_response('search.html', locals(), context_instance=RequestContext(request))
dataset/ETHPy150Open nicksergeant/snipt-old/views.py/search/original