Ticket #8630: 8630_r8782_alternative.diff
File 8630_r8782_alternative.diff, 1.7 KB (added by , 16 years ago) |
---|
-
django/contrib/comments/templatetags/comments.py
2 2 from django.template.loader import render_to_string 3 3 from django.conf import settings 4 4 from django.contrib.contenttypes.models import ContentType 5 from django.contrib import comments5 from django.contrib.comments import get_comment_app 6 6 from django.utils.encoding import smart_unicode 7 7 8 8 register = template.Library() … … 59 59 def __init__(self, ctype=None, object_pk_expr=None, object_expr=None, as_varname=None, comment=None): 60 60 if ctype is None and object_expr is None: 61 61 raise template.TemplateSyntaxError("Comment nodes must be given either a literal object or a ctype and object pk.") 62 self.comment_model = comments.get_model()62 self.comment_model = get_comment_app().get_model() 63 63 self.as_varname = as_varname 64 64 self.ctype = ctype 65 65 self.object_pk_expr = object_pk_expr … … 117 117 def get_form(self, context): 118 118 ctype, object_pk = self.get_target_ctype_pk(context) 119 119 if object_pk: 120 return comments.get_form()(ctype.get_object_for_this_type(pk=object_pk))120 return get_comment_app().get_form()(ctype.get_object_for_this_type(pk=object_pk)) 121 121 else: 122 122 return None 123 123 … … 243 243 244 244 <form action="{% comment_form_target %}" method="POST"> 245 245 """ 246 return comments.get_form_target()246 return get_comment_app().get_form_target() 247 247 248 248 register.tag(get_comment_count) 249 249 register.tag(get_comment_list)