Index: django/contrib/comments/forms.py
===================================================================
--- django/contrib/comments/forms.py	(revision 9699)
+++ django/contrib/comments/forms.py	(working copy)
@@ -7,7 +7,7 @@
 from django.conf import settings
 from django.http import Http404
 from django.contrib.contenttypes.models import ContentType
-from models import Comment
+from django.contrib import comments
 from django.utils.encoding import force_unicode
 from django.utils.hashcompat import sha_constructor
 from django.utils.text import get_text_list
@@ -15,12 +15,7 @@
 
 COMMENT_MAX_LENGTH = getattr(settings,'COMMENT_MAX_LENGTH', 3000)
 
-class CommentForm(forms.Form):
-    name          = forms.CharField(label=_("Name"), max_length=50)
-    email         = forms.EmailField(label=_("Email address"))
-    url           = forms.URLField(label=_("URL"), required=False)
-    comment       = forms.CharField(label=_('Comment'), widget=forms.Textarea,
-                                    max_length=COMMENT_MAX_LENGTH)
+class BaseCommentForm(forms.Form):
     honeypot      = forms.CharField(required=False,
                                     label=_('If you enter anything in this field '\
                                             'your comment will be treated as spam'))
@@ -34,48 +29,15 @@
         if initial is None:
             initial = {}
         initial.update(self.generate_security_data())
-        super(CommentForm, self).__init__(data=data, initial=initial)
+        super(BaseCommentForm, self).__init__(data=data, initial=initial)
 
     def get_comment_object(self):
         """
         Return a new (unsaved) comment object based on the information in this
-        form. Assumes that the form is already validated and will throw a
-        ValueError if not.
-
-        Does not set any of the fields that would come from a Request object
-        (i.e. ``user`` or ``ip_address``).
+        form. Subclasses must implement this.
         """
-        if not self.is_valid():
-            raise ValueError("get_comment_object may only be called on valid forms")
+        raise NotImplementedError("subclasses must implement get_comment_object")
 
-        new = Comment(
-            content_type = ContentType.objects.get_for_model(self.target_object),
-            object_pk    = force_unicode(self.target_object._get_pk_val()),
-            user_name    = self.cleaned_data["name"],
-            user_email   = self.cleaned_data["email"],
-            user_url     = self.cleaned_data["url"],
-            comment      = self.cleaned_data["comment"],
-            submit_date  = datetime.datetime.now(),
-            site_id      = settings.SITE_ID,
-            is_public    = True,
-            is_removed   = False,
-        )
-
-        # Check that this comment isn't duplicate. (Sometimes people post comments
-        # twice by mistake.) If it is, fail silently by returning the old comment.
-        possible_duplicates = Comment.objects.filter(
-            content_type = new.content_type,
-            object_pk = new.object_pk,
-            user_name = new.user_name,
-            user_email = new.user_email,
-            user_url = new.user_url,
-        )
-        for old in possible_duplicates:
-            if old.submit_date.date() == new.submit_date.date() and old.comment == new.comment:
-                return old
-
-        return new
-
     def security_errors(self):
         """Return just those errors associated with security"""
         errors = ErrorDict()
@@ -155,3 +117,53 @@
         """Generate a (SHA1) security hash from the provided info."""
         info = (content_type, object_pk, timestamp, settings.SECRET_KEY)
         return sha_constructor("".join(info)).hexdigest()
+
+
+class CommentForm(BaseCommentForm):
+    name          = forms.CharField(label=_("Name"), max_length=50)
+    email         = forms.EmailField(label=_("Email address"))
+    url           = forms.URLField(label=_("URL"), required=False)
+    comment       = forms.CharField(label=_('Comment'), widget=forms.Textarea,
+                                    max_length=COMMENT_MAX_LENGTH)
+
+    def get_comment_object(self):
+        """
+        Return a new (unsaved) comment object based on the information in this
+        form. Assumes that the form is already validated and will throw a
+        ValueError if not.
+
+        Does not set any of the fields that would come from a Request object
+        (i.e. ``user`` or ``ip_address``).
+        """
+        if not self.is_valid():
+            raise ValueError("get_comment_object may only be called on valid forms")
+        
+        comment_model = comments.get_model()
+        
+        new = comment_model(
+            content_type = ContentType.objects.get_for_model(self.target_object),
+            object_pk    = force_unicode(self.target_object._get_pk_val()),
+            user_name    = self.cleaned_data["name"],
+            user_email   = self.cleaned_data["email"],
+            user_url     = self.cleaned_data["url"],
+            comment      = self.cleaned_data["comment"],
+            submit_date  = datetime.datetime.now(),
+            site_id      = settings.SITE_ID,
+            is_public    = True,
+            is_removed   = False,
+        )
+
+        # Check that this comment isn't duplicate. (Sometimes people post comments
+        # twice by mistake.) If it is, fail silently by returning the old comment.
+        possible_duplicates = comment_model.objects.filter(
+            content_type = new.content_type,
+            object_pk = new.object_pk,
+            user_name = new.user_name,
+            user_email = new.user_email,
+            user_url = new.user_url,
+        )
+        for old in possible_duplicates:
+            if old.submit_date.date() == new.submit_date.date() and old.comment == new.comment:
+                return old
+
+        return new
 
