#NEWLINE# def render_activity( context , activity , template_prefix = '' , missing_data_policy = LOG ) : #NEWLINE# #INDENT# if ( hasattr ( activity , 'enriched' ) and ( not activity . enriched ) ) : #NEWLINE# #INDENT# handle_not_enriched_data ( activity , missing_data_policy ) #NEWLINE# return '' #NEWLINE# #UNINDENT# if ( template_prefix != '' ) : #NEWLINE# #INDENT# template_prefix = ( '%s_' % template_prefix ) #NEWLINE# #UNINDENT# if ( 'activities' in activity ) : #NEWLINE# #INDENT# template_name = ( 'activity/aggregated/%s%s.html' % ( context , activity [ 'verb' ] ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# template_name = ( 'activity/%s%s.html' % ( template_prefix , activity [ 'verb' ] ) ) #NEWLINE# #UNINDENT# tmpl = loader . get_template ( template_name ) #NEWLINE# context [ 'activity' ] = activity #NEWLINE# context = Context ( context ) #NEWLINE# return tmpl . render ( context )