Ticket #10559: 10559.diff

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

git-patch against the latest checkout

  • docs/ref/contrib/comments/custom.txt

    diff --git a/docs/ref/contrib/comments/custom.txt b/docs/ref/contrib/comments/custom.txt
    index 064bbca..4d2946f 100644
    a b the ``my_custom_app`` directory:: 
    6363In the ``models.py`` we'll define a ``CommentWithTitle`` model::
    6464
    6565    from django.db import models
    66     from django.contrib.comments.models import BaseCommentAbstractModel
     66    from django.contrib.comments.models import Comment
    6767
    68     class CommentWithTitle(BaseCommentAbstractModel):
     68    class CommentWithTitle(Comment):
    6969        title = models.CharField(max_length=300)
    70    
    71 All custom comment models must subclass :class:`BaseCommentAbstractModel`.
     70
     71Ideally, most custom comment models could subclass the :class:`Comment`
     72model.
     73
     74If you want to substantially remove or change the fields available in the
     75:class:`Comment` model but wouldn't want to rewrite the templates, you
     76could try subclassing from :class:`BaseCommentAbstractModel`.
    7277
    7378Next, we'll define a custom comment form in ``forms.py``. This is a little more
    7479tricky: we have to both create a form and override
    The :mod:`django.contrib.comments` app defines the following methods; any custom 
    177182    Return the URL for the "approve this comment from moderation" view.
    178183
    179184    The default implementation returns a reverse-resolved URL pointing
    180     to the :func:`django.contrib.comments.views.moderation.approve` view.
    181  No newline at end of file
     185    to the :func:`django.contrib.comments.views.moderation.approve` view.
Back to Top