The built-in comment models¶
-
class
Comment
¶ Django’s built-in comment model. Has the following fields:
-
content_object
¶ A
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
GenericForeignKey
, it’s actually syntactic sugar on top of two underlying attributes, described below.
-
content_type
¶ A
ForeignKey
toContentType
; this is the type of the object the comment is attached to.
-
site
¶ A
ForeignKey
to theSite
on which the comment was posted.
-
user
¶ A
ForeignKey
to theUser
who posted the comment. May be blank if the comment was posted by an unauthenticated user.
-
user_name
¶ The name of the user who posted the comment.
-
user_email
¶ The email of the user who posted the comment.
-
user_url
¶ The URL entered by the person who posted the comment.
-
comment
¶ The actual content of the comment itself.
-
submit_date
¶ The date the comment was submitted.
-
ip_address
¶ The IP address of the user posting the comment.
-
is_public
¶ False
if the comment is in moderation (see Generic comment moderation); IfTrue
, the comment will be displayed on the site.
-
is_removed
¶ True
if the comment was removed. Used to keep track of removed comments instead of just deleting them.
-