@register.inclusion_tag(u'generic/includes/comments.html', takes_context=True)
def comments_for(context, obj):
 form_class = import_dotted_path(settings.COMMENT_FORM_CLASS)
 form = form_class(context[u'request'], obj)
 context_form = context.get(u'posted_comment_form', form)
 context.update({u'posted_comment_form': (context_form if (context_form.target_object == obj) else form), u'unposted_comment_form': form, u'comment_url': reverse(u'comment'), u'object_for_comments': obj})
 return context

@ register . inclusion_tag ( u'generic/includes/comments.html' , takes_context = True ) def comments_for ( context , obj ) : form_class = import_dotted_path ( settings . COMMENT_FORM_CLASS ) form = form_class ( context [ u'request' ] , obj ) context_form = context . get ( u'posted_comment_form' , form ) context . update ( { u'posted_comment_form' : ( context_form if ( context_form . target_object == obj ) else form ) , u'unposted_comment_form' : form , u'comment_url' : reverse ( u'comment' ) , u'object_for_comments' : obj } ) return context
provides a generic context variable name for the object that comments are being rendered for .