删除评论（自己发的话题所有的都可以删除，否则只能删自己发的）
        
        :param topic_id: 话题ID
        :param comment_id: 评论ID
        :param reason: 原因 0/1/2 （内容不符/反动/其它）
        :param other: 其它原因的具体(2)
        :return: None
507028
def remove_comment(self, topic_id, comment_id, reason='0', other=None):
        
        params = {'cid': comment_id}
        data = {'cid': comment_id, 'ck': self.api.ck(), 'reason': reason, 'other': other, 'submit': '确定'}
        r = self.api.req(API_GROUP_REMOVE_COMMENT % topic_id, 'post', params, data)
        if r.text.find('douban_admin') > -1:
            r = self.api.req(API_GROUP_ADMIN_REMOVE_COMMENT % topic_id, 'post', params, data)
        self.api.logger.debug('remove comment final url is <%s>' % r.url)
        return r
900363
def itemComment(self, commentId):
        
        url = "%s/comments/%s" % (self.root, commentId)
        params = {
            "f": "json"
        }
        return self._get(url,
                            params,
                            securityHandler=self._securityHandler,
                            proxy_port=self._proxy_port,
                             proxy_url=self._proxy_url)
999453
def conversations_read(self, id):
        
        id = self.__unpack_id(id)
        url = '/api/v1/conversations/{0}/read'.format(str(id))
        return self.__api_request('POST', url)
894468
protected function topicsEndpoint($id = null)
    {
        return $id === null ? $this->topicsEndpoint : $this->topicsEndpoint . '/' . $id;
    }
1100011
public static URI setElementID(final URI relativePath, final String id) {
        String topic = getTopicID(relativePath);
        if (topic != null) {
            return setFragment(relativePath, topic + (id != null ? SLASH + id : ""));
        } else if (id == null) {
            return stripFragment(relativePath);
        } else {
            throw new IllegalArgumentException(relativePath.toString());
        }
    }
750305
def forum_topic_delete(self, topic_id):
        
        return self._get('forum_topics/{0}.json'.format(topic_id),
                         method='DELETE', auth=True)
446428
def query_get_comment(comID):
    
    query1 = """SELECT id,
                       id_bibrec,
                       id_user,
                       body,
                       """ + \
        datetime_format('date_creation') + ', ' \
        """
                       star_score,
                       nb_votes_yes,
                       nb_votes_total,
                       title,
                       nb_abuse_reports,
                       round_name,
                       restriction
                FROM "cmtRECORDCOMMENT"
                WHERE id=%s"""
    params1 = (comID,)
    res1 = run_sql(query1, params1)
    if len(res1) > 0:
        return res1[0]
    else:
        return ()
1266306
def get_property_id_from_set_topic(self, topic):
        """"""
        topic = topic.decode()
        return int(topic.split("/")[-3].split("_")[-1])
901009
def get_topic(self):
        
        if not hasattr(self, 'topic'):
            self.topic = get_object_or_404(
                Topic.objects.select_related('forum').all(), pk=self.kwargs['pk'],
            )
        return self.topic
1303791
def delete_topic_groups(self, group_id, topic_id):
        
        path = {}
        data = {}
        params = {}

        # REQUIRED - PATH - group_id
        """ID"""
        path["group_id"] = group_id

        # REQUIRED - PATH - topic_id
        """ID"""
        path["topic_id"] = topic_id

        self.logger.debug("DELETE /api/v1/groups/{group_id}/discussion_topics/{topic_id} with query params: {params} and form data: {data}".format(params=params, data=data, **path))
        return self.generic_request("DELETE", "/api/v1/groups/{group_id}/discussion_topics/{topic_id}".format(**path), data=data, params=params, no_data=True)
914710
def get_discussion_post(discussion_id, post_id, params = nil)
      raise Error, "Discussion ID is required" unless discussion_id.is_a? Numeric
      raise Error, "Discussion Post ID is required" unless post_id.is_a? Numeric
      get("/#{workroom_check(params)}discussions/#{discussion_id}/discussion_posts/#{post_id}.json")
    end
1308657
def community_topic_subscriptions(self, topic_id, **kwargs):
        ""
        api_path = "/api/v2/community/topics/{topic_id}/subscriptions.json"
        api_path = api_path.format(topic_id=topic_id)
        return self.call(api_path, **kwargs)
486228
def comment_unvote(self, comment_id):
        
        return self._get('posts/{0}/unvote.json'.format(comment_id),
                         method='POST', auth=True)
1326076
def delete_post(request, post_id, topic_id):
    
    try:
        topic = Topic.objects.get(id=topic_id)
        post = Post.objects.get(id=post_id)
    except:
        messages.error(request, 'Sorry, but this post can not be found. It may have been deleted already.')
        raise Http404
    return_url = "/forum/%s/%s/%s/" % (topic.forum.slug, topic.slug, topic_id)
    if request.user.is_authenticated() and (request.user.is_staff or request.user.id == post.author.id):
        post.delete()
        update_post_relations(request.user, topic, deleting=True)
        topic_posts = topic.post_set.count()
        pmax = (topic_posts / PAGINATE_BY) + 1

        # if no posts are left, delete topic.
        if topic_posts == 0:
            topic.delete()
            return HttpResponseRedirect("/forum/%s/" % topic.forum.slug)

        return HttpResponseRedirect("%spage%s/" % (return_url, pmax))
    else:
        raise Http404
37224
def comment_delete(self, comment_id):
        
        return self._get('comments/{0}.json'.format(comment_id),
                         method='DELETE', auth=True)
523344
def complain(self, id, is_spam):
        
        r = self.request('post', 'http://cleanweb-api.yandex.ru/1.0/complain',
                         data={'id': id, 'spamtype': 'spam' if is_spam else 'ham'})
        return True
52631
def request_comment_show(self, request_id, id, **kwargs):
        ""
        api_path = "/api/v2/requests/{request_id}/comments/{id}.json"
        api_path = api_path.format(request_id=request_id, id=id)
        return self.call(api_path, **kwargs)