1
.. _ref-contrib-comments-forms:
7
.. module:: django.contrib.comments.forms
8
:synopsis: Forms for dealing with the built-in comment model.
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>`.
14
.. class:: CommentForm
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.
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.
23
Abstract comment forms for custom comment apps
24
----------------------------------------------
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
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:
33
.. class:: CommentSecurityForm
35
Handles the anti-spoofing protection aspects of the comment form handling.
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.
43
.. class:: CommentDetailsForm
45
Handles the details of the comment itself.
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'