~ubuntu-branches/ubuntu/quantal/python-django/quantal

« back to all changes in this revision

Viewing changes to docs/ref/contrib/comments/forms.txt

  • Committer: Bazaar Package Importer
  • Author(s): Chris Lamb
  • Date: 2009-07-29 11:26:28 UTC
  • mfrom: (1.1.8 upstream) (4.1.5 sid)
  • Revision ID: james.westby@ubuntu.com-20090729112628-pg09ino8sz0sj21t
Tags: 1.1-1
* New upstream release.
* Merge from experimental:
  - Ship FastCGI initscript and /etc/default file in python-django's examples
    directory (Closes: #538863)
  - Drop "05_10539-sphinx06-compatibility.diff"; it has been applied
    upstream.
  - Bump Standards-Version to 3.8.2.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
.. _ref-contrib-comments-forms:
 
2
 
 
3
====================
 
4
Comment form classes
 
5
====================
 
6
 
 
7
.. module:: django.contrib.comments.forms
 
8
   :synopsis: Forms for dealing with the built-in comment model.
 
9
 
 
10
The ``django.contrib.comments.forms`` module contains a handful of forms
 
11
you'll use when writing custom views dealing with comments, or when writing
 
12
:ref:`custom comment apps <ref-contrib-comments-custom>`.
 
13
 
 
14
.. class:: CommentForm
 
15
 
 
16
   The main comment form representing the standard, built-in way of handling
 
17
   submitted comments. This is the class used by all the views
 
18
   :mod:`django.contrib.comments` to handle submitted comments.
 
19
 
 
20
   If you want to build custom views that are similar to Django's built-in
 
21
   comment handling views, you'll probably want to use this form.
 
22
 
 
23
Abstract comment forms for custom comment apps
 
24
----------------------------------------------
 
25
 
 
26
If you're building a :ref:`custom comment app <ref-contrib-comments-custom>`,
 
27
you might want to replace *some* of the form logic but still rely on parts of
 
28
the existing form.
 
29
 
 
30
:class:`CommentForm` is actually composed of a couple of abstract base class
 
31
forms that you can subclass to reuse pieces of the form handling logic:
 
32
 
 
33
.. class:: CommentSecurityForm
 
34
 
 
35
   Handles the anti-spoofing protection aspects of the comment form handling.
 
36
 
 
37
   This class contains the ``content_type`` and ``object_pk`` fields pointing
 
38
   to the object the comment is attached to, along with a ``timestamp`` and a
 
39
   ``security_hash`` of all the form data. Together, the timestamp and the
 
40
   security hash ensure that spammers can't "replay" form submissions and
 
41
   flood you with comments.
 
42
 
 
43
.. class:: CommentDetailsForm
 
44
 
 
45
   Handles the details of the comment itself.
 
46
 
 
47
   This class contains the ``name``, ``email``, ``url``, and the ``comment``
 
48
   field itself, along with the associated valdation logic.
 
 
b'\\ No newline at end of file'