#NEWLINE# def post( self , revision_id ) : #NEWLINE# #INDENT# '\n            .. http:post:: /api/1/revisions/<int:revision_id>/comments\n\n            Create a new Revision Comment.\n\n            **Example Request**:\n\n            .. sourcecode:: http\n\n                POST /api/1/revisions/1141/comments HTTP/1.1\n                Host: example.com\n                Accept: application/json\n\n                {\n                    "text": "This is a Revision Comment."\n                }\n\n\n            **Example Response**:\n\n            .. sourcecode:: http\n\n                HTTP/1.1 201 OK\n                Vary: Accept\n                Content-Type: application/json\n\n                {\n                    \'id\': 22,\n                    \'revision_id\': 1141,\n                    "date_created": "2013-10-04 22:01:47",\n                    \'text\': \'This is a Revision Comment.\'\n                }\n\n            :statuscode 201: Revision Comment Created\n            :statuscode 401: Authentication Error. Please Login.\n        ' #NEWLINE# self . reqparse . add_argument ( 'text' , required = False , type = unicode , help = 'Must provide comment' , location = 'json' ) #NEWLINE# args = self . reqparse . parse_args ( ) #NEWLINE# irc = ItemRevisionComment ( ) #NEWLINE# irc . user_id = current_user . id #NEWLINE# irc . revision_id = revision_id #NEWLINE# irc . text = args [ 'text' ] #NEWLINE# irc . date_created = datetime . datetime . utcnow ( ) #NEWLINE# db . session . add ( irc ) #NEWLINE# db . session . commit ( ) #NEWLINE# db . session . refresh ( irc ) #NEWLINE# revision_marshaled = marshal ( irc . __dict__ , REVISION_COMMENT_FIELDS ) #NEWLINE# revision_marshaled = dict ( ( revision_marshaled . items ( ) + { #NEWLINE# #INDENT# 'user' : irc . user . email , #NEWLINE# #UNINDENT# } . items ( ) ) ) #NEWLINE# return ( revision_marshaled , 200 )