diff options
Diffstat (limited to 'docs/ref/contrib/comments')
-rw-r--r-- | docs/ref/contrib/comments/custom.txt | 2 | ||||
-rw-r--r-- | docs/ref/contrib/comments/example.txt | 20 | ||||
-rw-r--r-- | docs/ref/contrib/comments/forms.txt | 6 | ||||
-rw-r--r-- | docs/ref/contrib/comments/index.txt | 14 | ||||
-rw-r--r-- | docs/ref/contrib/comments/models.txt | 64 | ||||
-rw-r--r-- | docs/ref/contrib/comments/moderation.txt | 2 | ||||
-rw-r--r-- | docs/ref/contrib/comments/settings.txt | 6 | ||||
-rw-r--r-- | docs/ref/contrib/comments/signals.txt | 8 | ||||
-rw-r--r-- | docs/ref/contrib/comments/upgrade.txt | 8 |
9 files changed, 56 insertions, 74 deletions
diff --git a/docs/ref/contrib/comments/custom.txt b/docs/ref/contrib/comments/custom.txt index 9e32fc4fed..49299d4d33 100644 --- a/docs/ref/contrib/comments/custom.txt +++ b/docs/ref/contrib/comments/custom.txt @@ -1,5 +1,3 @@ -.. _ref-contrib-comments-custom: - ================================== Customizing the comments framework ================================== diff --git a/docs/ref/contrib/comments/example.txt b/docs/ref/contrib/comments/example.txt index d4ce623bb0..424bdb13f5 100644 --- a/docs/ref/contrib/comments/example.txt +++ b/docs/ref/contrib/comments/example.txt @@ -1,5 +1,3 @@ -.. _ref-contrib-comments-example: - .. highlightlang:: html+django =========================================== @@ -7,7 +5,7 @@ Example of using the in-built comments app =========================================== Follow the first three steps of the quick start guide in the -:ref:`documentation <ref-contrib-comments-index>`. +:doc:`documentation </ref/contrib/comments/index>`. Now suppose, you have an app (``blog``) with a model (``Post``) to which you want to attach comments. Let us also suppose that @@ -85,8 +83,8 @@ It looks for the ``form.html`` under the following directories Since we customize the form in the second method, we make use of another tag called :ttag:`comment_form_target`. This tag on rendering gives the URL -where the comment form is posted. Without any :ref:`customization -<ref-contrib-comments-custom>`, :ttag:`comment_form_target` evaluates to +where the comment form is posted. Without any :doc:`customization +</ref/contrib/comments/custom>`, :ttag:`comment_form_target` evaluates to ``/comments/post/``. We use this tag in the form's ``action`` attribute. The :ttag:`get_comment_form` tag renders a ``form`` for a model instance by @@ -136,7 +134,7 @@ found under the directory structure we saw for ``form.html``. Feeds ===== -Suppose you want to export a :ref:`feed <ref-contrib-syndication>` of the +Suppose you want to export a :doc:`feed </ref/contrib/syndication>` of the latest comments, you can use the in-built :class:`LatestCommentFeed`. Just enable it in your project's ``urls.py``: @@ -163,8 +161,8 @@ Moderation Now that we have the comments framework working, we might want to have some moderation setup to administer the comments. The comments framework comes -in-built with :ref:`generic comment moderation -<ref-contrib-comments-moderation>`. The comment moderation has the following +in-built with :doc:`generic comment moderation +</ref/contrib/comments/moderation>`. The comment moderation has the following features (all of which or only certain can be enabled): * Enable comments for a particular model instance. @@ -181,18 +179,18 @@ following way: from django.contrib.comments.moderation import CommentModerator, moderator from django.db import models - + class Post(models.Model): title = models.CharField(max_length = 255) content = models.TextField() posted_date = models.DateTimeField() - + class PostModerator(CommentModerator): email_notification = True auto_close_field = 'posted_date' # Close the comments after 7 days. close_after = 7 - + moderator.register(Post, PostModerator) The generic comment moderation also has the facility to remove comments. diff --git a/docs/ref/contrib/comments/forms.txt b/docs/ref/contrib/comments/forms.txt index 3eacb5db54..c21a27bb9e 100644 --- a/docs/ref/contrib/comments/forms.txt +++ b/docs/ref/contrib/comments/forms.txt @@ -1,5 +1,3 @@ -.. _ref-contrib-comments-forms: - ==================== Comment form classes ==================== @@ -9,7 +7,7 @@ Comment form classes The ``django.contrib.comments.forms`` module contains a handful of forms you'll use when writing custom views dealing with comments, or when writing -:ref:`custom comment apps <ref-contrib-comments-custom>`. +:doc:`custom comment apps </ref/contrib/comments/custom>`. .. class:: CommentForm @@ -23,7 +21,7 @@ you'll use when writing custom views dealing with comments, or when writing Abstract comment forms for custom comment apps ---------------------------------------------- -If you're building a :ref:`custom comment app <ref-contrib-comments-custom>`, +If you're building a :doc:`custom comment app </ref/contrib/comments/custom>`, you might want to replace *some* of the form logic but still rely on parts of the existing form. diff --git a/docs/ref/contrib/comments/index.txt b/docs/ref/contrib/comments/index.txt index 9f1d3cd6e4..817871e976 100644 --- a/docs/ref/contrib/comments/index.txt +++ b/docs/ref/contrib/comments/index.txt @@ -1,5 +1,3 @@ -.. _ref-contrib-comments-index: - =========================== Django's comments framework =========================== @@ -16,7 +14,7 @@ it for comments on blog entries, photos, book chapters, or anything else. .. note:: If you used to use Django's older (undocumented) comments framework, you'll - need to upgrade. See the :ref:`upgrade guide <ref-contrib-comments-upgrade>` + need to upgrade. See the :doc:`upgrade guide </ref/contrib/comments/upgrade>` for instructions. Quick start guide @@ -42,7 +40,7 @@ To get started using the ``comments`` app, follow these steps: #. Use the `comment template tags`_ below to embed comments in your templates. -You might also want to examine :ref:`ref-contrib-comments-settings`. +You might also want to examine :doc:`/ref/contrib/comments/settings`. Comment template tags ===================== @@ -124,7 +122,7 @@ For example:: {% endfor %} This returns a list of :class:`~django.contrib.comments.models.Comment` objects; -see :ref:`the comment model documentation <ref-contrib-comments-models>` for +see :doc:`the comment model documentation </ref/contrib/comments/models>` for details. .. templatetag:: get_comment_permalink @@ -212,7 +210,7 @@ Rendering a custom comment form ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ If you want more control over the look and feel of the comment form, you use use -:ttag:`get_comment_form` to get a :ref:`form object <topics-forms-index>` that +:ttag:`get_comment_form` to get a :doc:`form object </topics/forms/index>` that you can use in the template:: {% get_comment_form for [object] as [varname] %} @@ -279,8 +277,8 @@ should know about: it with a warning field; if you use the comment form with a custom template you should be sure to do the same. -The comments app also depends on the more general :ref:`Cross Site Request -Forgery protection < ref-contrib-csrf>` that comes with Django. As described in +The comments app also depends on the more general :doc:`Cross Site Request +Forgery protection </ref/contrib/csrf>` that comes with Django. As described in the documentation, it is best to use ``CsrfViewMiddleware``. However, if you are not using that, you will need to use the ``csrf_protect`` decorator on any views that include the comment form, in order for those views to be able to diff --git a/docs/ref/contrib/comments/models.txt b/docs/ref/contrib/comments/models.txt index af85d68f00..e773790d65 100644 --- a/docs/ref/contrib/comments/models.txt +++ b/docs/ref/contrib/comments/models.txt @@ -1,82 +1,80 @@ -.. _ref-contrib-comments-models: - =========================== The built-in comment models =========================== .. module:: django.contrib.comments.models :synopsis: The built-in comment models - + .. class:: Comment Django's built-in comment model. Has the following fields: - + .. attribute:: content_object - + A :class:`~django.contrib.contettypes.generic.GenericForeignKey` attribute pointing to the object the comment is attached to. You can use this to get at the related object (i.e. ``my_comment.content_object``). - + Since this field is a :class:`~django.contrib.contettypes.generic.GenericForeignKey`, it's actually syntactic sugar on top of two underlying attributes, described below. - + .. attribute:: content_type - + A :class:`~django.db.models.ForeignKey` to :class:`~django.contrib.contenttypes.models.ContentType`; this is the type of the object the comment is attached to. - + .. attribute:: object_pk - + A :class:`~django.db.models.TextField` containing the primary key of the object the comment is attached to. - + .. attribute:: site - + A :class:`~django.db.models.ForeignKey` to the :class:`~django.contrib.sites.models.Site` on which the comment was posted. - + .. attribute:: user - + A :class:`~django.db.models.ForeignKey` to the :class:`~django.contrib.auth.models.User` who posted the comment. May be blank if the comment was posted by an unauthenticated user. - + .. attribute:: user_name - + The name of the user who posted the comment. - + .. attribute:: user_email - - The email of the user who posteed the comment. - + + The email of the user who posted the comment. + .. attribute:: user_url - + The URL entered by the person who posted the comment. - + .. attribute:: comment - + The actual content of the comment itself. - + .. attribute:: submit_date - + The date the comment was submitted. - + .. attribute:: ip_address - + The IP address of the user posting the comment. - + .. attribute:: is_public - + ``False`` if the comment is in moderation (see - :ref:`ref-contrib-comments-moderation`); If ``True``, the comment will + :doc:`/ref/contrib/comments/moderation`); If ``True``, the comment will be displayed on the site. - + .. attribute:: is_removed - + ``True`` if the comment was removed. Used to keep track of removed comments instead of just deleting them. - + diff --git a/docs/ref/contrib/comments/moderation.txt b/docs/ref/contrib/comments/moderation.txt index 2c4072ba5b..198f78fa89 100644 --- a/docs/ref/contrib/comments/moderation.txt +++ b/docs/ref/contrib/comments/moderation.txt @@ -1,5 +1,3 @@ -.. _ref-contrib-comments-moderation: - ========================== Generic comment moderation ========================== diff --git a/docs/ref/contrib/comments/settings.txt b/docs/ref/contrib/comments/settings.txt index ff94d2dbcc..1f1aecafd4 100644 --- a/docs/ref/contrib/comments/settings.txt +++ b/docs/ref/contrib/comments/settings.txt @@ -1,5 +1,3 @@ -.. _ref-contrib-comments-settings: - ================ Comment settings ================ @@ -29,7 +27,7 @@ this will be rejected. Defaults to 3000. COMMENTS_APP ------------ -An app which provides :ref:`customization of the comments framework -<ref-contrib-comments-custom>`. Use the same dotted-string notation +An app which provides :doc:`customization of the comments framework +</ref/contrib/comments/custom>`. Use the same dotted-string notation as in :setting:`INSTALLED_APPS`. Your custom :setting:`COMMENTS_APP` must also be listed in :setting:`INSTALLED_APPS`. diff --git a/docs/ref/contrib/comments/signals.txt b/docs/ref/contrib/comments/signals.txt index cd406b56dd..7ae34a1900 100644 --- a/docs/ref/contrib/comments/signals.txt +++ b/docs/ref/contrib/comments/signals.txt @@ -1,5 +1,3 @@ -.. _ref-contrib-comments-signals: - ================================ Signals sent by the comments app ================================ @@ -7,9 +5,9 @@ Signals sent by the comments app .. module:: django.contrib.comments.signals :synopsis: Signals sent by the comment module. -The comment app sends a series of :ref:`signals <topics-signals>` to allow for -comment moderation and similar activities. See :ref:`the introduction to signals -<topics-signals>` for information about how to register for and receive these +The comment app sends a series of :doc:`signals </topics/signals>` to allow for +comment moderation and similar activities. See :doc:`the introduction to signals +</topics/signals>` for information about how to register for and receive these signals. comment_will_be_posted diff --git a/docs/ref/contrib/comments/upgrade.txt b/docs/ref/contrib/comments/upgrade.txt index dc9bff868c..3d6b5af668 100644 --- a/docs/ref/contrib/comments/upgrade.txt +++ b/docs/ref/contrib/comments/upgrade.txt @@ -1,5 +1,3 @@ -.. _ref-contrib-comments-upgrade: - =============================================== Upgrading from Django's previous comment system =============================================== @@ -11,8 +9,8 @@ The main changes from the old system are: * This new system is documented. - * It uses modern Django features like :ref:`forms <topics-forms-index>` and - :ref:`modelforms <topics-forms-modelforms>`. + * It uses modern Django features like :doc:`forms </topics/forms/index>` and + :doc:`modelforms </topics/forms/modelforms>`. * It has a single ``Comment`` model instead of separate ``FreeComment`` and ``Comment`` models. @@ -42,7 +40,7 @@ The data models for Django's comment system have changed, as have the table names. Before you transfer your existing data into the new comments system, make sure that you have installed the new comments system as explained in the -:ref:`quick start guide <ref-contrib-comments-index>`. +:doc:`quick start guide </ref/contrib/comments/index>`. This will ensure that the new tables have been properly created. To transfer your data into the new comments system, you'll need to directly |