#NEWLINE# def _get_detail_value( var , attr ) : #NEWLINE# #INDENT# "\n    Given a variable and one of its attributes that are available inside of\n    a template, return its 'method' if it is a callable, its class name if it\n    is a model manager, otherwise return its value\n    " #NEWLINE# value = getattr ( var , attr ) #NEWLINE# kls = getattr ( getattr ( value , '__class__' , '' ) , '__name__' , '' ) #NEWLINE# if ( kls in ( 'ManyRelatedManager' , 'RelatedManager' , 'EmptyManager' ) ) : #NEWLINE# #INDENT# return kls #NEWLINE# #UNINDENT# if callable ( value ) : #NEWLINE# #INDENT# return 'routine' #NEWLINE# #UNINDENT# return value