#NEWLINE# def playlist_category_details( request , slug , parent_slug = None , template_name = 'playlist/category_details.html' , extra_context = None ) : #NEWLINE# #INDENT# context = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# if parent_slug : #NEWLINE# #INDENT# context [ 'object' ] = shortcuts . get_object_or_404 ( PlaylistCategory , parent__slug = parent_slug , slug = slug ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# context [ 'object' ] = shortcuts . get_object_or_404 ( PlaylistCategory , slug = slug ) #NEWLINE# #UNINDENT# context [ 'object_list' ] = Playlist . objects . filter ( ( Q ( category__slug = slug ) | Q ( category__parent__slug = slug ) ) ) . select_related ( ) #NEWLINE# context . update ( ( extra_context or { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) ) #NEWLINE# return shortcuts . render_to_response ( template_name , context , context_instance = template . RequestContext ( request ) )