mirror of https://github.com/django/django.git
Fixed #10559 -- Clarified documentation on customization of comments pages. Thanks to Thejaswi Puthraya for the patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10566 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
e6d2b14e35
commit
565c190611
|
@ -63,12 +63,15 @@ the ``my_custom_app`` directory::
|
|||
In the ``models.py`` we'll define a ``CommentWithTitle`` model::
|
||||
|
||||
from django.db import models
|
||||
from django.contrib.comments.models import BaseCommentAbstractModel
|
||||
from django.contrib.comments.models import Comment
|
||||
|
||||
class CommentWithTitle(BaseCommentAbstractModel):
|
||||
class CommentWithTitle(Comment):
|
||||
title = models.CharField(max_length=300)
|
||||
|
||||
All custom comment models must subclass :class:`BaseCommentAbstractModel`.
|
||||
Most custom comment models will subclass the :class:`Comment` model. However,
|
||||
if you want to substantially remove or change the fields available in the
|
||||
:class:`Comment` model, but don't want to rewrite the templates, you could
|
||||
try subclassing from :class:`BaseCommentAbstractModel`.
|
||||
|
||||
Next, we'll define a custom comment form in ``forms.py``. This is a little more
|
||||
tricky: we have to both create a form and override
|
||||
|
|
Loading…
Reference in New Issue