#NEWLINE# @ register . inclusion_tag ( 'admin/tree_change_list_results.html' , takes_context = True ) #NEWLINE# def result_tree( context , cl , request ) : #NEWLINE# #INDENT# "\n    Added 'filtered' param, so the template's js knows whether the results have\n    been affected by a GET param or not. Only when the results are not filtered\n    you can drag and sort the tree\n    " #NEWLINE# headers = list ( result_headers ( cl ) ) #NEWLINE# headers . insert ( ( 1 if needs_checkboxes ( context ) else 0 ) , { #NEWLINE# #INDENT# 'text' : '+' , #NEWLINE# 'sortable' : True , #NEWLINE# 'url' : request . path , #NEWLINE# 'tooltip' : _ ( 'Return to ordered tree' ) , #NEWLINE# 'class_attrib' : mark_safe ( ' class="oder-grabber"' ) , #NEWLINE# #UNINDENT# } ) #NEWLINE# return { #NEWLINE# #INDENT# 'filtered' : ( not check_empty_dict ( request . GET ) ) , #NEWLINE# 'result_hidden_fields' : list ( result_hidden_fields ( cl ) ) , #NEWLINE# 'result_headers' : headers , #NEWLINE# 'results' : list ( results ( cl ) ) , #NEWLINE# #UNINDENT# }