#NEWLINE# @ login_required #NEWLINE# def search_history( request ) : #NEWLINE# #INDENT# '\n    Provides the search history for a logged-in user.\n    ' #NEWLINE# if ( not ( type ( request . user . _wrapped ) is User ) ) : #NEWLINE# #INDENT# return HttpResponseRedirect ( reverse ( 'login' ) ) #NEWLINE# #UNINDENT# template = loader . get_template ( 'isisdata/search_history.html' ) #NEWLINE# searchqueries = request . user . searches . order_by ( '-created_on' ) #NEWLINE# paginator = Paginator ( searchqueries , 10 ) #NEWLINE# page = request . GET . get ( 'page' ) #NEWLINE# try : #NEWLINE# #INDENT# searchqueries = paginator . page ( page ) #NEWLINE# #UNINDENT# except PageNotAnInteger : #NEWLINE# #INDENT# searchqueries = paginator . page ( 1 ) #NEWLINE# #UNINDENT# except EmptyPage : #NEWLINE# #INDENT# searchqueries = paginator . page ( paginator . num_pages ) #NEWLINE# #UNINDENT# context = RequestContext ( request , { #NEWLINE# #INDENT# 'searchqueries' : request , #NEWLINE# #UNINDENT# } ) #NEWLINE# return HttpResponse ( template . render ( context ) )