def comments(context, reference_to=None, depth=0):
    blog_post = context.get('object')
    if not reference_to:
        reference_id = get_reference_id(blog_post, 'author')
        reference_type = 'post'
    else:
        reference_id = get_reference_id(reference_to)
        reference_type = 'comment'
    comment_list = get_comments(reference_to=reference_id, is_spam=False)
    return dict(comments=comment_list,
                blog_post=blog_post,
                form=CommentForm(reference_type=reference_type, reference_to=reference_id),
                user=context['user'],
                depth=depth,
                next_depth=depth+1,
                span=12-depth)
def blog_summary(context):
    return dict(blog_post=context['object'],
                comment_count=get_comment_count(reference_to=get_reference_id(context['object'], 'author'), is_spam=False),
                user=context['user'])
def blog_detail(context):
    return dict(blog_post=context['object'],
                comments=get_comments(reference_to=get_reference_id(context['object'], 'author'), is_spam=False),
                user=context['user'])