Returns Django comment object with this wordpress id
175099
def lookup_comment_by_wordpress_id(self, comment_id, comments):
        
        for comment in comments:
            if comment.wordpress_id == comment_id:
                return comment
48567
def comments(self, request_id):
        
        return self._query_zendesk(self.endpoint.comments, 'comment', id=request_id)
238117
def get_comments(self):
        
        bug = str(self._bug['id'])
        res = self._bugsy.request('bug/%s/comment' % bug)

        return [Comment(bugsy=self._bugsy, **comments) for comments
                in res['bugs'][bug]['comments']]
849815
def get_object_comment_reference(instance, title=None):
    
    span = '<span data-object-type="%s.%s" data-object-pk="%s">%s</span>' % (
        instance.__module__,
        instance.__class__.__name__,
        instance.pk,
        instance if title is None else title
    )
    try:
        return '<a href="%s">%s</a>' % (
            instance.get_absolute_url(),
            span
        )
    except AttributeError:
        return span
359732
public function getComment($comment_id)
    {
        list($response, $statusCode, $httpHeader) = $this->getCommentWithHttpInfo ($comment_id);
        return $response; 
    }
292738
def community_post_comment_show(self, post_id, id, **kwargs):
        ""
        api_path = "/api/v2/community/posts/{post_id}/comments/{id}.json"
        api_path = api_path.format(post_id=post_id, id=id)
        return self.call(api_path, **kwargs)
1116814
def comment_undelete(self, comment_id):
        
        return self._get('comments/{0}/undelete.json'.format(comment_id),
                         method='POST', auth=True)
288568
function getComments(id) {
    $.ajax({
     type: 'GET',
     url: opts.getCommentsURL,
     data: {node: id},
     success: function(data, textStatus, request) {
       var ul = $('#cl' + id);
       var speed = 100;
       $('#cf' + id)
         .find('textarea[name="proposal"]')
         .data('source', data.source);

       if (data.comments.length === 0) {
         ul.html('<li>No comments yet.</li>');
         ul.data('empty', true);
       } else {
         // If there are comments, sort them and put them in the list.
         var comments = sortComments(data.comments);
         speed = data.comments.length * 100;
         appendComments(comments, ul);
         ul.data('empty', false);
       }
       $('#cn' + id).slideUp(speed + 200);
       ul.slideDown(speed);
     },
     error: function(request, textStatus, error) {
       showError('Oops, there was a problem retrieving the comments.');
     },
     dataType: 'json'
    });
  }
360747
def comments(self, limit=None):
        
        return self._reddit._limit_get(self.permalink, limit=limit)[1]
644979
def post_comment(self, bugid, comment):
        ''''''
        data = {'id': bugid, "comment": comment}
        return self._post('bug/{bugid}/comment'.format(bugid=bugid), json.dumps(data))
838490
def comments_for(context, obj):
    
    form_class = import_dotted_path(settings.COMMENT_FORM_CLASS)
    form = form_class(context["request"], obj)
    context_form = context.get("posted_comment_form", form)
    context.update({
        'posted_comment_form':
            context_form if context_form.target_object == obj else form,
        'unposted_comment_form': form,
        'comment_url': reverse("comment"),
        'object_for_comments': obj,
    })
    return context
607755
def report(request, comment_id):
    

    comment = get_object_or_404(
        django_comments.get_model(), pk=comment_id, site__pk=settings.SITE_ID)
    if comment.parent is not None:
        messages.info(request, _('Reporting comment replies is not allowed.'))
    else:
        perform_flag(request, comment)
        messages.info(request, _('The comment has been reported.'))

    next = request.GET.get('next') or comment.get_absolute_url()
    return HttpResponseRedirect(next)
747962
def get_by_id(self, reply_id):
        '''
        
        '''
        reply = MReply.get_by_uid(reply_id)
        logger.info('get_reply: {0}'.format(reply_id))

        self.render('misc/reply/show_reply.html',
                    reply=reply,
                    username=reply.user_name,
                    date=reply.date,
                    vote=reply.vote,
                    uid=reply.uid,
                    userinfo=self.userinfo,
                    kwd={})
50558
def get_comment_init(request, obj):
    
    if request.user.is_authenticated():
        init = {'obj': obj, 'username': request.user.username, 'email': request.user.email}
    else:
        init = {'obj': obj}
    return init
1132808
def formfield_for_foreignkey(self, db_field, request=None, **kwargs):
        
        field = super(CommentReplyAdmin, self).\
            formfield_for_foreignkey(db_field, request, **kwargs)
        comment_id = request.GET.get(self.fk_name, None)

        if db_field.name == 'canned_reply' and comment_id:
            comment_id = comment_id.split(',')
            comment_sites = Comment.objects.filter(id__in=comment_id)\
                                           .values('site')\
                                           .distinct()
            field.queryset = field.queryset.filter(Q(site__in=comment_sites) |
                                                   Q(site__isnull=True))
        return field
341236
def reply(self, text):
        
        data = {
            'thing_id': self.name,
            'id': '#commentreply_{0}'.format(self.name),
            'text': text,
        }
        j = self._reddit.post('api', 'comment', data=data)
        try:
            return self._reddit._thingify(j['json']['data']['things'][0], path=self._path)
        except Exception:
            raise UnexpectedResponse(j)
108516
def comment(request, template="generic/comments.html", extra_context=None):
    
    response = initial_validation(request, "comment")
    if isinstance(response, HttpResponse):
        return response
    obj, post_data = response
    form_class = import_dotted_path(settings.COMMENT_FORM_CLASS)
    form = form_class(request, obj, post_data)
    if form.is_valid():
        url = obj.get_absolute_url()
        if is_spam(request, form, url):
            return redirect(url)
        comment = form.save(request)
        response = redirect(add_cache_bypass(comment.get_absolute_url()))
        # Store commenter's details in a cookie for 90 days.
        for field in ThreadedCommentForm.cookie_fields:
            cookie_name = ThreadedCommentForm.cookie_prefix + field
            cookie_value = post_data.get(field, "")
            set_cookie(response, cookie_name, cookie_value)
        return response
    elif request.is_ajax() and form.errors:
        return HttpResponse(dumps({"errors": form.errors}))
    # Show errors with stand-alone comment form.
    context = {"obj": obj, "posted_comment_form": form}
    context.update(extra_context or {})
    return TemplateResponse(request, template, context)