#NEWLINE# def change_view( self , request , object_id , extra_context = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) : #NEWLINE# #INDENT# '\n        Used to redirect users back to their filtered list of locations if there were any.\n        Save the referer of the page to return to the filtered change_list after saving the page\n        ' #NEWLINE# result = super ( EnhancedModelAdmin , self ) . change_view ( request , object_id , extra_context = extra_context ) #NEWLINE# ref = request . META . get ( 'HTTP_REFERER' , '' ) #NEWLINE# if ( ref . find ( '?' ) != ( - 1 ) ) : #NEWLINE# #INDENT# request . session [ 'filtered' ] = object_id #NEWLINE# #UNINDENT# if request . POST . has_key ( '_save' ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# if ( request . session [ 'filtered' ] is not None ) : #NEWLINE# #INDENT# result [ 'Location' ] = request . session [ 'filtered' ] #NEWLINE# request . session [ 'filtered' ] = None #NEWLINE# #UNINDENT# #UNINDENT# except Exception : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# #UNINDENT# return result