Permalink
Browse files

EditComment and DeleteComment plus bug and doc fixes.

  • Loading branch information...
1 parent cd48706 commit 74246a0de6584f8bf00842aae51578af67a2c074 cgroskopf committed May 25, 2011
Showing with 30 additions and 5 deletions.
  1. +30 −5 wordpress_xmlrpc/methods/comments.py
View
35 wordpress_xmlrpc/methods/comments.py
@@ -2,28 +2,53 @@
from wordpress_xmlrpc.mixins import *
from wordpress_xmlrpc.wordpress import WordPressComment
-class GetComment(AuthParamsOffsetMixin, AuthenticatedMethod):
+class GetComment(AuthenticatedMethod):
"""
Retreive an individual comment.
Parameters:
- `blog_id`: ID of the blog hosting the comment.
`comment_id`: ID of the comment to retrieve.
Returns: `WordPressPost` instance.
"""
method_name = 'wp.getComment'
- method_args = ('blog_id', 'post_id', )
+ method_args = ('comment_id', )
results_class = WordPressComment
-class NewComment(AuthParamsOffsetMixin, AuthenticatedMethod):
+class NewComment(AuthenticatedMethod):
"""
Create a new comment
Parameters:
+ `post_id`: The id of the post to add a comment to.
`comment`: A `WordPressComment` instance with at least the `content` value set.
Returns: ID of the newly-created comment (an integer).
"""
method_name = 'wp.newComment'
- method_args = ('blog_id', 'post_id', 'comment', )
+ method_args = ('post_id', 'comment', )
+
+class EditComment(AuthenticatedMethod):
+ """
+ Edit an existing comment
+
+ Parameters:
+ `comment_id`: The idea of the comment to edit.
+ `comment`: A `WordPressComment` instance with at least the `content` value set.
+
+ Returns: ID of the newly-created comment (an integer).
+ """
+ method_name = 'wp.editComment'
+ method_args = ('comment_id', 'comment', )
+
+class DeleteComment(AuthenticatedMethod):
+ """
+ Edit an existing comment
+
+ Parameters:
+ `comment`: The id of the comment to be deleted.
+
+ Returns: ID of the newly-created comment (an integer).
+ """
+ method_name = 'wp.deleteComment'
+ method_args = ('comment_id', )

0 comments on commit 74246a0

Please sign in to comment.