Version 6.x.x Source

Table Name: tabComment

Fields

Sr Fieldname Type Label Options
1 comment Text Comment
2 comment_type Data Comment Type
Email
Chat
Phone
SMS
Created
Submitted
Cancelled
Assigned
Assignment Completed
Comment
Workflow
Label
Attachment
Attachment Removed
Like
3 comment_by Data Comment By
4 comment_by_fullname Data Comment By Fullname
5 comment_date Date Comment Date
6 comment_time Data Comment Time
7 comment_doctype Data Comment Doctype
8 comment_docname Data Comment Docname
9 post_topic Data Post Topic
10 unsubscribed Check Unsubscribed
11 reference_doctype Link Reference DocType DocType
12 reference_name Dynamic Link Reference Name

Reference DocType and Reference Name are used to render a comment as a link (href) to a Doc.

reference_doctype

Controller

frappe.core.doctype.comment.comment

Class Comment

Inherits from frappe.model.document.Document

Comments are added to Documents via forms or views like blogs etc.

after_insert (self)

Send realtime updates


get_comments_from_parent (self)

No docs


get_feed (self)

Returns feed HTML from Comment.


notify_mentions (self)

No docs


on_trash (self)

Removes from _comments in parent Document


on_update (self)

Updates _comments property in parent Document.


update_comment_in_doc (self)

Updates _comments (JSON) property in parent Document. Creates a column _comments if property does not exist.

_comments format

{
    "comment": [String],
    "by": [user],
    "name": [Comment Document name]
}

update_comments_in_parent (self, _comments)

Updates _comments property in parent Document with given dict.

Parameters:


validate (self)

Raise exception for more than 50 comments.



frappe.core.doctype.comment.comment.on_doctype_update ()

Add index to tabComment (comment_doctype, comment_name)