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

« back to all changes in this revision

Viewing changes to docs/ref/contrib/comments/models.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-models:
 
2
 
 
3
===========================
 
4
The built-in comment models
 
5
===========================
 
6
 
 
7
.. module:: django.contrib.comments.models
 
8
   :synopsis: The built-in comment models
 
9
  
 
10
.. class:: Comment
 
11
 
 
12
    Django's built-in comment model. Has the following fields:
 
13
    
 
14
    .. attribute:: content_object
 
15
    
 
16
        A :class:`~django.contrib.contettypes.generic.GenericForeignKey`
 
17
        attribute pointing to the object the comment is attached to. You can use
 
18
        this to get at the related object (i.e. ``my_comment.content_object``).
 
19
        
 
20
        Since this field is a
 
21
        :class:`~django.contrib.contettypes.generic.GenericForeignKey`, it's
 
22
        actually syntactic sugar on top of two underlying attributes, described
 
23
        below.
 
24
    
 
25
    .. attribute:: content_type
 
26
   
 
27
        A :class:`~django.db.models.ForeignKey` to
 
28
        :class:`~django.contrib.contenttypes.models.ContentType`; this is the
 
29
        type of the object the comment is attached to.
 
30
      
 
31
    .. attribute:: object_pk
 
32
    
 
33
        A :class:`~django.db.models.TextField` containing the primary
 
34
        key of the object the comment is attached to.
 
35
        
 
36
    .. attribute:: site
 
37
    
 
38
        A :class:`~django.db.models.ForeignKey` to the
 
39
        :class:`~django.contrib.sites.models.Site` on which the comment was
 
40
        posted.
 
41
        
 
42
    .. attribute:: user
 
43
    
 
44
        A :class:`~django.db.models.ForeignKey` to the
 
45
        :class:`~django.contrib.auth.models.User` who posted the comment.
 
46
        May be blank if the comment was posted by an unauthenticated user.
 
47
        
 
48
    .. attribute:: user_name
 
49
    
 
50
        The name of the user who posted the comment.
 
51
    
 
52
    .. attribute:: user_email
 
53
    
 
54
        The email of the user who posteed the comment.
 
55
    
 
56
    .. attribute:: user_url
 
57
    
 
58
        The URL entered by the person who posted the comment.
 
59
    
 
60
    .. attribute:: comment
 
61
    
 
62
        The actual content of the comment itself.
 
63
    
 
64
    .. attribute:: submit_date
 
65
    
 
66
        The date the comment was submitted.
 
67
    
 
68
    .. attribute:: ip_address
 
69
    
 
70
        The IP address of the user posting the comment.
 
71
    
 
72
    .. attribute:: is_public
 
73
    
 
74
        ``False`` if the comment is in moderation (see
 
75
        :ref:`ref-contrib-comments-moderation`); If ``True``, the comment will
 
76
        be displayed on the site.
 
77
    
 
78
    .. attribute:: is_removed
 
79
    
 
80
        ``True`` if the comment was removed. Used to keep track of removed
 
81
        comments instead of just deleting them.
 
82