#NEWLINE# def needs_instance( f ) : #NEWLINE# #INDENT# def wrapper( * args , **kwargs ) : #NEWLINE# #INDENT# if ( args [ 0 ] . instance is None ) : #NEWLINE# #INDENT# raise AttributeError ( 'This method requires an instance of the model.' ) #NEWLINE# #UNINDENT# return f ( * args , ** kwargs ) #NEWLINE# #UNINDENT# return f