@register.inclusion_tag('zinnia/tags/dummy.html', takes_context=True)
def get_categories_tree(context, template='zinnia/tags/categories_tree.html'):
 return {'template': template, 'categories': Category.objects.all().annotate(count_entries=Count('entries')), 'context_category': context.get('category')}

@ register . inclusion_tag ( 'zinnia/tags/dummy.html' , takes_context = True ) def get_categories_tree ( context , template = 'zinnia/tags/categories_tree.html' ) : return { 'template' : template , 'categories' : Category . objects . all ( ) . annotate ( count_entries = Count ( 'entries' ) ) , 'context_category' : context . get ( 'category' ) }
return the categories as a tree .