def obj_create(self, bundle, request=None, **kwargs): bundle = super(CommentResource, self).obj_create(bundle, user_id=request.user.id, document_id=kwargs.get("document_id"), date_created=datetime.now()) comment_done.send(sender=self, comment_id=bundle.obj) return bundle
def obj_create(self, bundle, request=None, **kwargs): bundle = super(CommentResource, self).obj_create(bundle, user_id=request.user.id, document_id=kwargs.get("document_id"), date_created=datetime.now() ) comment_done.send(sender=self, comment_id=bundle.obj ) return bundle
def obj_create(self, bundle, request=None, **kwargs): """ - Creates new comment - Fires comment_done signal """ bundle = super(CommentResource, self).obj_create(bundle, user_id=request.user.id, document_id=kwargs.get("document_id"), date_created=datetime.now()) comment_id = bundle.obj comment = Comment.objects.get(_id=ObjectId(comment_id)) comment_done.send(sender=self, comment_id=comment_id, instance=comment) bundle.obj = comment return bundle
def obj_create(self, bundle, request=None, **kwargs): """ - Creates new comment - Fires comment_done signal """ bundle = super(CommentResource, self).obj_create( bundle, user_id=request.user.id, document_id=kwargs.get("document_id"), date_created=datetime.now() ) comment_id = bundle.obj comment = Comment.objects.get(_id=ObjectId(comment_id)) comment_done.send( sender=self, comment_id=comment_id, instance=comment ) bundle.obj = comment return bundle