#NEWLINE# def children( self , page , **kwargs ) : #NEWLINE# #INDENT# base_url = page . get_absolute_url ( ) #NEWLINE# root = getattr ( settings , 'MEDIA_GALLERIES_ROOT' , None ) #NEWLINE# if root : #NEWLINE# #INDENT# obj_root = Folder . objects . get ( name = root ) #NEWLINE# category_list = Folder . objects . filter ( parent = obj_root ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# category_list = Folder . objects . filter ( parent = None ) #NEWLINE# #UNINDENT# for category in category_list : #NEWLINE# #INDENT# subchildren = [ ] #NEWLINE# for subcategory in category . media_folder_children . all ( ) : #NEWLINE# #INDENT# subchildren . append ( PagePretender ( title = subcategory , url = ( '%s%s/%s/' % ( base_url , category . name , subcategory . name ) ) , level = 5 ) ) #NEWLINE# #UNINDENT# ( yield PagePretender ( title = category , url = ( '%s%s/' % ( base_url , category . name ) ) , children = subchildren , level = 5 ) )