#NEWLINE# def category_categories( request , slug , start = 0 , template_name = 'lfs/catalog/categories/category/default.html' ) : #NEWLINE# #INDENT# 'Displays the child categories of the category with passed slug.\n\n    This view is called if the user chooses a template that is situated in settings.CATEGORY_PATH ".\n    ' #NEWLINE# cache_key = ( '%s-category-categories-2-%s' % ( settings . CACHE_MIDDLEWARE_KEY_PREFIX , slug ) ) #NEWLINE# result = cache . get ( cache_key ) #NEWLINE# if ( request is not None ) : #NEWLINE# #INDENT# return result #NEWLINE# #UNINDENT# category = lfs_get_object_or_404 ( Category , slug = slug ) #NEWLINE# format_info = category . get_format_info ( ) #NEWLINE# amount_of_cols = format_info [ 'category_cols' ] #NEWLINE# categories = [ ] #NEWLINE# row = [ ] #NEWLINE# for ( i , children ) in enumerate ( category . get_children ( ) ) : #NEWLINE# #INDENT# row . append ( children ) #NEWLINE# if ( ( ( i + 1 ) % amount_of_cols ) == 0 ) : #NEWLINE# #INDENT# categories . append ( row ) #NEWLINE# row = [ ] #NEWLINE# #UNINDENT# #UNINDENT# if ( len ( row ) > 0 ) : #NEWLINE# #INDENT# categories . append ( row ) #NEWLINE# #UNINDENT# render_template = category . get_template_name ( ) #NEWLINE# if ( render_template != None ) : #NEWLINE# #INDENT# template_name = render_template #NEWLINE# #UNINDENT# result_html = render_to_string ( template_name , RequestContext ( request , { #NEWLINE# #INDENT# 'category' : category , #NEWLINE# 'categories' : categories , #NEWLINE# #UNINDENT# } ) ) #NEWLINE# result = { #NEWLINE# #INDENT# 'pagination_data' : { #NEWLINE# #INDENT# 'current_page' : 1 , #NEWLINE# 'total_pages' : 1 , #NEWLINE# 'getparam' : 'start' , #NEWLINE# #UNINDENT# } , #NEWLINE# 'html' : result_html , #NEWLINE# #UNINDENT# } #NEWLINE# cache . set ( cache_key , result ) #NEWLINE# return result