diff --git a/django/contrib/comments/templatetags/comments.py b/django/contrib/comments/templatetags/comments.py index 563a3ff..b5b02c8 100644 --- a/django/contrib/comments/templatetags/comments.py +++ b/django/contrib/comments/templatetags/comments.py @@ -7,6 +7,8 @@ from django.utils.encoding import smart_unicode register = template.Library() +comment_app = comments.get_comment_app() + class BaseCommentNode(template.Node): """ Base helper class (abstract) for handling the get_comment_* template tags. @@ -59,7 +61,7 @@ class BaseCommentNode(template.Node): def __init__(self, ctype=None, object_pk_expr=None, object_expr=None, as_varname=None, comment=None): if ctype is None and object_expr is None: raise template.TemplateSyntaxError("Comment nodes must be given either a literal object or a ctype and object pk.") - self.comment_model = comments.get_model() + self.comment_model = comment_app.get_model() self.as_varname = as_varname self.ctype = ctype self.object_pk_expr = object_pk_expr @@ -117,7 +119,7 @@ class CommentFormNode(BaseCommentNode): def get_form(self, context): ctype, object_pk = self.get_target_ctype_pk(context) if object_pk: - return comments.get_form()(ctype.get_object_for_this_type(pk=object_pk)) + return comment_app.get_form()(ctype.get_object_for_this_type(pk=object_pk)) else: return None @@ -243,7 +245,7 @@ def comment_form_target():