#NEWLINE# def get_item_or_404( method = None , **decorator_kwargs ) : #NEWLINE# #INDENT# if ( method is None ) : #NEWLINE# #INDENT# return functools . partial ( get_item_or_404 , ** wrapped ) #NEWLINE# #UNINDENT# @ functools . wraps ( method ) #NEWLINE# def wrapped( self , * args , **kwargs ) : #NEWLINE# #INDENT# id = self . get_data_id ( kwargs ) #NEWLINE# item = self . get_item_or_404 ( id , ** decorator_kwargs ) #NEWLINE# for id_field in self . id_fields : #NEWLINE# #INDENT# del kwargs [ id_field ] #NEWLINE# #UNINDENT# return method ( self , item , * args , ** kwargs ) #NEWLINE# #UNINDENT# return wrapped