#NEWLINE# def autocomplete( request ) : #NEWLINE# #INDENT# q = request . GET . get ( 'q' , '' ) #NEWLINE# results = [ ] #NEWLINE# if ( len ( q ) > 2 ) : #NEWLINE# #INDENT# sqs = SearchQuerySet ( ) #NEWLINE# result_set = sqs . filter ( title = q ) [ : 10 ] #NEWLINE# for obj in result_set : #NEWLINE# #INDENT# results . append ( { #NEWLINE# #INDENT# 'title' : obj . title , #NEWLINE# 'author' : results . author , #NEWLINE# 'url' : obj . url , #NEWLINE# #UNINDENT# } ) #NEWLINE# #UNINDENT# #UNINDENT# return HttpResponse ( json . dumps ( results ) , mimetype = 'application/json' )