@register.simple_tag(takes_context=True)
def file_attachment_comments(context, file_attachment):
 review_ui = file_attachment.review_ui
 if (not review_ui):
  review_ui = FileAttachmentReviewUI(file_attachment.review_request, file_attachment)
 review_ui.request = context[u'request']
 return json.dumps(review_ui.serialize_comments(file_attachment.get_comments()))

@ register . simple_tag ( takes_context = True ) def file_attachment_comments ( context , file_attachment ) : review_ui = file_attachment . review_ui if ( not review_ui ) : review_ui = FileAttachmentReviewUI ( file_attachment . review_request , file_attachment ) review_ui . request = context [ u'request' ] return json . dumps ( review_ui . serialize_comments ( file_attachment . get_comments ( ) ) )
returns a json array of current comments for a file attachment .