#NEWLINE# @ menu_item ( MenuItem . MAGIC ) #NEWLINE# @ submenu_item ( MenuItem . Magic . SPELLS ) #NEWLINE# def spell_index( request ) : #NEWLINE# #INDENT# if is_admin ( request ) : #NEWLINE# #INDENT# f = SpellFilterAdmin ( request . GET , queryset = Spell . objects . select_related ( 'rulebook' , 'rulebook__dnd_edition' , 'school' , 'verified_author' ) . distinct ( ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# f = SpellFilter ( request . GET , queryset = Spell . objects . select_related ( 'rulebook' , 'rulebook__dnd_edition' , 'school' ) . distinct ( ) ) #NEWLINE# #UNINDENT# paginator = DndPaginator ( f . qs , request ) #NEWLINE# form_submitted = ( 1 if ( '_filter' in request . GET ) else 0 ) #NEWLINE# return render_to_response ( 'dnd/spells/spell_index.html' , { #NEWLINE# #INDENT# 'request' : request , #NEWLINE# 'spell_list' : paginator . items ( ) , #NEWLINE# 'paginator' : paginator , #NEWLINE# 'filter' : f , #NEWLINE# 'form_submitted' : form_submitted , #NEWLINE# #UNINDENT# } , context_instance = RequestContext ( request ) )