The built-in comment models¶
- class Comment¶
Django’s built-in comment model. Has the following fields:
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.
The name of the user who posted the comment.
The email of the user who posted the comment.
The URL entered by the person who posted the comment.
The actual content of the comment itself.
The date the comment was submitted.
The IP address of the user posting the comment.
False if the comment is in moderation (see Generic comment moderation); If True, the comment will be displayed on the site.
True if the comment was removed. Used to keep track of removed comments instead of just deleting them.
Having trouble? We'd like to help!
- Try the FAQ — it's got answers to many common questions.
- Search for information in the archives of the django-users mailing list, or post a question.
- Ask a question in the #django IRC channel, or search the IRC logs to see if it has been asked before.
- If you notice errors with this documentation, please open a ticket and let us know! Please only use the ticket tracker for criticisms and improvements on the docs. For tech support, use the resources above.