#NEWLINE# def section( section_name , app , model ) : #NEWLINE# #INDENT# ( app , model ) = map ( str . lower , [ app , model ] ) #NEWLINE# model_class = apps . get_model ( app , model ) #NEWLINE# change_perm = '{}.change_{}' . format ( app , model ) #NEWLINE# item = ralph_item ( title = section_name , url = 'admin:{}_{}_changelist' . format ( item , model ) , access_by_perms = '{}.view_{}' . format ( app , model ) , perms_mode_all = False , children = [ ralph_item ( title = _ ( 'Add {}' . format ( model_class . _meta . verbose_name . lower ( ) ) ) , url = 'admin:{}_{}_add' . format ( app , model ) , access_by_perms = '{}.add_{}' . format ( app , model ) ) , ralph_item ( title = '{{ original }}' , url = 'admin:{}_{}_change original.id' . format ( app , model ) , access_by_perms = change_perm , children = get_menu_items_for_admin ( '{}_{}' . format ( app , model ) , change_perm ) ) ] ) #NEWLINE# item . _app = app #NEWLINE# item . _model = model #NEWLINE# return item