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

« back to all changes in this revision

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

  • Committer: Bazaar Package Importer
  • Author(s): Jamie Strandboge
  • Date: 2010-10-12 11:34:35 UTC
  • mfrom: (1.2.7 upstream)
  • mto: This revision was merged to the branch mainline in revision 30.
  • Revision ID: james.westby@ubuntu.com-20101012113435-9lnsrh0i3mxozbt0
Tags: upstream-1.2.3
ImportĀ upstreamĀ versionĀ 1.2.3

Show diffs side-by-side

added added

removed removed

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