#NEWLINE# def lookups( self , request , model_admin ) : #NEWLINE# #INDENT# ' Determine the lookups we want to use ' #NEWLINE# path_values = Page . objects . order_by ( 'path' ) . values_list ( 'path' , flat = True ) #NEWLINE# path_set = [ ] #NEWLINE# for v in path_values : #NEWLINE# #INDENT# if ( v == '' ) : #NEWLINE# #INDENT# path_set . append ( ( '' , '/' ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# parts = v . split ( '/' ) [ : 2 ] #NEWLINE# new_value = '/' . join ( parts ) #NEWLINE# new_tuple = ( new_value , new_value ) #NEWLINE# if ( new_tuple not in path_set ) : #NEWLINE# #INDENT# path_set . append ( ( new_value , new_value ) ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# return path_set