#NEWLINE# def _resolve( value , model_instance = None , context = None ) : #NEWLINE# #INDENT# ' Resolves any template references in the given value. \n    ' #NEWLINE# if ( isinstance ( value , basestring ) and ( '{' in value ) ) : #NEWLINE# #INDENT# if ( context is None ) : #NEWLINE# #INDENT# context = Context ( ) #NEWLINE# #UNINDENT# if ( model_instance is not None ) : #NEWLINE# #INDENT# context [ model_instance . _meta . module_name ] = model_instance #NEWLINE# #UNINDENT# value = Template ( value ) . render ( context ) #NEWLINE# #UNINDENT# return value