#NEWLINE# @ menu_item ( 'items' ) #NEWLINE# @ submenu_item ( 'by_rulebooks' ) #NEWLINE# def items_in_rulebook_mobile( request , rulebook_slug , rulebook_id ) : #NEWLINE# #INDENT# rulebook = get_object_or_404 ( Rulebook , pk = rulebook_id ) #NEWLINE# if ( not ( rulebook . slug == rulebook_slug ) ) : #NEWLINE# #INDENT# return permanent_redirect_view ( request , items_in_rulebook_mobile , kwargs = { #NEWLINE# #INDENT# 'rulebook_slug' : rulebook . slug , #NEWLINE# 'rulebook_id' : rulebook_id , #NEWLINE# #UNINDENT# } ) #NEWLINE# #UNINDENT# item_list = rulebook . item_set . select_related ( 'rulebook' , 'rulebook__dnd_edition' , 'school' ) . all ( ) #NEWLINE# paginator = DndMobilePaginator ( item_list , request ) #NEWLINE# return render_to_response ( 'dnd/mobile/items/items_in_rulebook.html' , { #NEWLINE# #INDENT# 'rulebook' : rulebook_slug , #NEWLINE# 'item_list' : paginator . items ( ) , #NEWLINE# 'paginator' : paginator , #NEWLINE# 'request' : request , #NEWLINE# 'display_3e_warning' : is_3e_edition ( rulebook . dnd_edition ) , #NEWLINE# #UNINDENT# } , context_instance = RequestContext ( request ) )