own_comments.models
Module Contents
Classes
A comment thread, represented in the DB |
|
- class own_comments.models.Thread
Bases:
own_comments.database.Base
A comment thread, represented in the DB
- __tablename__ = threads
- id
- path
An arbitrary path identifying the comment thread. It’s recommended to use the path part of a URL.
- date_created
When this thread was created.
- auto_approve
Whether newly posted comments in this thread require the admin’s approval before being visible to visitors
- locked
Whether new comments can be added, or comments can be edited in this thread, by regular users.
- comments
- make_public(self)
Removes the update key from all comments in this thread. Does not remove from the persistent storage, just on the python object.
- class own_comments.models.Comment
Bases:
own_comments.database.Base
- __tablename__ = comments
- id
- author_name
Who posted this comment
- text
Content (ie, body) of this comment
- approved
Whether the comment is approved by the admin (moderation stuff). Unapproved comments should not be displayed to visitors.
- deleted
Whether the comment has been marked for removal by the admin or its author. Actually removing the comment from the DB is called “purge” in
own-comments
.
- date_created
When was the comment created
- date_updated
When was the comment updated
- update_key
A secret key that allows the author to modify or delete their comment.
- thread_id
The thread this comment belongs to
- thread
- make_public(self)
Clear the update key attribute non persistently. Use this before returning a comment to regular visitors.