File: models.txt

package info (click to toggle)
python-django 1.7.11-1%2Bdeb8u3
  • links: PTS, VCS
  • area: main
  • in suites: jessie
  • size: 45,624 kB
  • sloc: python: 171,189; xml: 713; sh: 203; makefile: 199; sql: 11
file content (91 lines) | stat: -rw-r--r-- 2,757 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
===========================
The built-in comment models
===========================

.. module:: django.contrib.comments.models
   :synopsis: The built-in comment models

.. warning::

    Django's comment framework has been deprecated and is no longer supported.
    Most users will be better served with a custom solution, or a hosted
    product like Disqus__.

    The code formerly known as ``django.contrib.comments`` is `still available
    in an external repository`__.

    __ https://disqus.com/
    __ https://github.com/django/django-contrib-comments

.. class:: Comment

    Django's built-in comment model. Has the following fields:

    .. attribute:: content_object

        A :class:`~django.contrib.contenttypes.fields.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.contenttypes.fields.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 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
        :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.