diff --git a/boards/views/api.py b/boards/views/api.py --- a/boards/views/api.py +++ b/boards/views/api.py @@ -28,7 +28,9 @@ STATUS_ERROR = 'error' @transaction.atomic def api_get_threaddiff(request, thread_id, last_update_time): - """Get posts that were changed or added since time""" + """ + Gets posts that were changed or added since time + """ thread = get_object_or_404(Post, id=thread_id).thread_new @@ -62,7 +64,7 @@ def api_get_threaddiff(request, thread_i def api_add_post(request, opening_post_id): """ - Add a post and return the JSON response for it + Adds a post and return the JSON response for it """ opening_post = get_object_or_404(Post, id=opening_post_id) @@ -96,7 +98,7 @@ def api_add_post(request, opening_post_i def get_post(request, post_id): """ - Get the html of a post. Used for popups. Post can be truncated if used + Gets the html of a post. Used for popups. Post can be truncated if used in threads list with 'truncated' get parameter. """ @@ -113,7 +115,7 @@ def get_post(request, post_id): # TODO Test this def api_get_threads(request, count): """ - Get the JSON thread opening posts list. + Gets the JSON thread opening posts list. Parameters that can be used for filtering: tag, offset (from which thread to get results) """ @@ -149,7 +151,7 @@ def api_get_threads(request, count): # TODO Test this def api_get_tags(request): """ - Get all tags or user tags. + Gets all tags or user tags. """ # TODO Get favorite tags for the given user ID @@ -166,11 +168,11 @@ def api_get_tags(request): # TODO Test this def api_get_thread_posts(request, opening_post_id): """ - Get the JSON array of thread posts + Gets the JSON array of thread posts """ opening_post = get_object_or_404(Post, id=opening_post_id) - thread = opening_post.thread_new + thread = opening_post.get_thread() posts = thread.get_replies() json_data = { @@ -189,7 +191,7 @@ def api_get_thread_posts(request, openin def api_get_post(request, post_id): """ - Get the JSON of a post. This can be + Gets the JSON of a post. This can be used as and API for external clients. """