Exemplo n.º 1
0
    def _createreply(self, commentmodel, request):
        '''
        Create reply comment.
        '''
        comment_id = database.add_comment(commentmodel)

        url = reverse("comment", (commentmodel.tablature_id, comment_id), request=request)
        return Response(status=status.HTTP_204_NO_CONTENT,
                        headers={"Location":url})
Exemplo n.º 2
0
 def _createcomment(self, commentmodel, request):
     '''
     Performs creation.
     Returns 201.
     '''
     comment_id = database.add_comment(commentmodel)
     url = reverse("comment", (commentmodel.tablature_id,comment_id,), request=request)
     #location = {"Location":url}
     return Response(status=status.HTTP_201_CREATED,
                     headers={"Location":url})