#NEWLINE# def run_detail( request , run_id ) : #NEWLINE# #INDENT# test_run = get_object_or_404 ( TestRun , id = run_id ) #NEWLINE# sort = request . GET . get ( 'sort' ) #NEWLINE# if ( sort == 'response_time' ) : #NEWLINE# #INDENT# order_by = '-timer_total' #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( sort == 'sql_queries' ) : #NEWLINE# #INDENT# order_by = '-sql_num_queries' #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( sort == 'sql_time' ) : #NEWLINE# #INDENT# order_by = '-sql_time' #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# order_by = '-timestamp' #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# test_run . set_aggregates ( ) #NEWLINE# p = Paginator ( test_run . records . order_by ( order_by ) , RECORDS_PER_PAGE ) #NEWLINE# try : #NEWLINE# #INDENT# page_num = int ( request . GET . get ( 'p' , 1 ) ) #NEWLINE# #UNINDENT# except ValueError : #NEWLINE# #INDENT# page_num = 1 #NEWLINE# #UNINDENT# page = p . page ( page_num ) #NEWLINE# return render_to_response ( 'debug_logging/run_detail.html' , { #NEWLINE# #INDENT# 'page' : page , #NEWLINE# 'test_run' : test_run , #NEWLINE# 'all_test_runs' : _get_all_test_runs ( ) , #NEWLINE# #UNINDENT# } , context_instance = RequestContext ( request ) )