<s> from django . template . loader import render_to_string <EOL> def connection_table_renderer ( connections , type , following ) : <EOL> """<STR_LIT>""" <EOL> rendered_connections = connection_row_renderer ( <EOL> connections , type , following ) <EOL> template_values = { <EOL> '<STR_LIT:type>' : type , <EOL> '<STR_LIT>' : rendered_connections , <EOL> } <EOL> return render_to_string ( '<STR_LIT>' , template_values ) <EOL> def connection_row_renderer ( connections , type , following ) : <EOL> rows = [ ] <EOL> for connection in connections : <EOL> follows = connection in following <EOL> template_values = { <EOL> '<STR_LIT:user>' : connection . user , <EOL> '<STR_LIT>' : str ( follows ) <EOL> } <EOL> rows . append ( <EOL> render_to_string ( '<STR_LIT>' , template_values ) ) <EOL> return rows </s>
