The comment models¶
-
class
django_comments.models.Comment¶ The comment model. Has the following fields:
-
content_object¶ A
GenericForeignKeyattribute 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
ForeignKeytoContentType; this is the type of the object the comment is attached to.
-
site¶ A
ForeignKeyto theSiteon which the comment was posted.
-
user¶ A
ForeignKeyto theUserwho 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¶ Falseif the comment is in moderation (see Generic comment moderation); IfTrue, the comment will be displayed on the site.
-
is_removed¶ Trueif the comment was removed. Used to keep track of removed comments instead of just deleting them.
-