#NEWLINE# def playlist_list( request , qs = Playlist . objects . all ( ) , template_name = 'playlist/playlist_list.html' , extra_context = None ) : #NEWLINE# #INDENT# context = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# qs = qs . select_related ( depth = 3 ) . filter ( tracks_count__gt = 7 ) #NEWLINE# context [ 'object_list' ] = qs #NEWLINE# s = '\n    select \n        t.id,\n        t.name \n    from tagging_taggeditem ti \n    left join tagging_tag t on t.id=ti.tag_id \n    group by t.id, t.name \n    order by count(ti.object_id) desc \n    limit 15\n    ' #NEWLINE# context [ 'best_tags' ] = Tag . objects . raw ( s ) #NEWLINE# context . update ( ( extra_context or { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) ) #NEWLINE# response = shortcuts . render_to_response ( template_name , context , context_instance = template . RequestContext ( request ) ) #NEWLINE# return response