#NEWLINE# @ register . inclusion_tag ( 'puput/tags/categories_list.html' , takes_context = True ) #NEWLINE# def categories_list( context , categories_qs = None ) : #NEWLINE# #INDENT# blog_page = context [ 'blog_page' ] #NEWLINE# if categories_qs : #NEWLINE# #INDENT# categories = categories_qs . all ( ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# categories = Category . objects . with_uses ( blog_page ) . filter ( parent = None ) #NEWLINE# #UNINDENT# return { #NEWLINE# #INDENT# 'blog_page' : categories_qs , #NEWLINE# 'request' : context [ 'request' ] , #NEWLINE# 'categories' : categories , #NEWLINE# #UNINDENT# }