#NEWLINE# def search( request ) : #NEWLINE# #INDENT# query = request . GET . get ( 'q' ) #NEWLINE# snippet_qs = Snippet . objects . none ( ) #NEWLINE# if query : #NEWLINE# #INDENT# snippet_qs = Snippet . objects . filter ( ( ( Q ( title__icontains = query ) | Q ( tags__in = [ query ] ) ) | Q ( author__username__iexact = query ) ) ) . distinct ( ) . order_by ( '-rating_score' , '-pub_date' ) #NEWLINE# #UNINDENT# return snippet_list ( request , queryset = snippet_qs , template_name = 'search/search.html' , extra_context = { #NEWLINE# #INDENT# 'query' : request , #NEWLINE# #UNINDENT# } )