Code

Ticket #10559: 10559.diff

File 10559.diff, 1.5 KB (added by thejaswi_puthraya, 5 years ago)

git-patch against the latest checkout

Line 
1diff --git a/docs/ref/contrib/comments/custom.txt b/docs/ref/contrib/comments/custom.txt
2index 064bbca..4d2946f 100644
3--- a/docs/ref/contrib/comments/custom.txt
4+++ b/docs/ref/contrib/comments/custom.txt
5@@ -63,12 +63,17 @@ the ``my_custom_app`` directory::
6 In the ``models.py`` we'll define a ``CommentWithTitle`` model::
7 
8     from django.db import models
9-    from django.contrib.comments.models import BaseCommentAbstractModel
10+    from django.contrib.comments.models import Comment
11 
12-    class CommentWithTitle(BaseCommentAbstractModel):
13+    class CommentWithTitle(Comment):
14         title = models.CharField(max_length=300)
15-   
16-All custom comment models must subclass :class:`BaseCommentAbstractModel`.
17+
18+Ideally, most custom comment models could subclass the :class:`Comment`
19+model.
20+
21+If you want to substantially remove or change the fields available in the
22+:class:`Comment` model but wouldn't want to rewrite the templates, you
23+could try subclassing from :class:`BaseCommentAbstractModel`.
24 
25 Next, we'll define a custom comment form in ``forms.py``. This is a little more
26 tricky: we have to both create a form and override
27@@ -177,4 +182,4 @@ The :mod:`django.contrib.comments` app defines the following methods; any custom
28     Return the URL for the "approve this comment from moderation" view.
29 
30     The default implementation returns a reverse-resolved URL pointing
31-    to the :func:`django.contrib.comments.views.moderation.approve` view.
32\ No newline at end of file
33+    to the :func:`django.contrib.comments.views.moderation.approve` view.