Return the admin URLs for the comment app used.
971195
def comment_admin_urlname(action):
    
    comment = get_comment_model()
    return 'admin:%s_%s_%s' % (
        comment._meta.app_label, comment._meta.model_name,
        action)
908850
def list(request, content_type, id):
    
    # get object
    app_label, model = content_type.split('-')
    ctype = ContentType.objects.get(app_label=app_label, model=model)
    obj = ctype.get_object_for_this_type(id=id)

    # setup template and return result
    t = Template("{% load comments %}{% render_comment_list for object %}")
    context = RequestContext(request)
    context.update({'object': obj})
    result = t.render(context)
    return HttpResponse(result)
454153
def get_admin_urls_for_registration(self):
        
        urls = super(OrderModelAdmin, self).get_admin_urls_for_registration()
        urls = urls + (
            url(self.url_helper.get_action_url_pattern('detail'),
                self.detail_view,
                name=self.url_helper.get_action_url_name('detail')),
        )
        return urls
327291
def marvcli_comment_rm(ids):
    
    app = create_app()
    db.session.query(Comment)\
              .filter(Comment.id.in_(ids))\
              .delete(synchronize_session=False)
    db.session.commit()
475932
def comments(recid):
    """"""
    from invenio_access.local_config import VIEWRESTRCOLL
    from invenio_access.mailcookie import \
        mail_cookie_create_authorize_action
    from .api import check_user_can_view_comments
    auth_code, auth_msg = check_user_can_view_comments(current_user, recid)
    if auth_code and current_user.is_guest:
        cookie = mail_cookie_create_authorize_action(VIEWRESTRCOLL, {
            'collection': g.collection})
        url_args = {'action': cookie, 'ln': g.ln, 'referer': request.referrer}
        flash(_("Authorization failure"), 'error')
        return redirect(url_for('webaccount.login', **url_args))
    elif auth_code:
        flash(auth_msg, 'error')
        abort(401)

    # FIXME check restricted discussion
    comments = CmtRECORDCOMMENT.query.filter(db.and_(
        CmtRECORDCOMMENT.id_bibrec == recid,
        CmtRECORDCOMMENT.in_reply_to_id_cmtRECORDCOMMENT == 0,
        CmtRECORDCOMMENT.star_score == 0
    )).order_by(CmtRECORDCOMMENT.date_creation).all()
    return render_template('comments/comments.html', comments=comments,
                           option='comments')
883375
def get_comment_template_name(comment):
    
    ctype = ContentType.objects.get_for_id(comment.content_type_id)
    return [
        "comments/%s/%s/comment.html" % (ctype.app_label, ctype.model),
        "comments/%s/comment.html" % ctype.app_label,
        "comments/comment.html"
    ]
620212
def get_comment_form(self, *args, **kwargs):
        """"""
        # Implemented from kitosid template for -
        # osid.resource.ResourceAdminSession.get_resource_form_for_update
        # This method might be a bit sketchy. Time will tell.
        if isinstance(args[-1], list) or 'comment_record_types' in kwargs:
            return self.get_comment_form_for_create(*args, **kwargs)
        else:
            return self.get_comment_form_for_update(*args, **kwargs)
634259
def get_urls(self):
        
        not_clone_url = [url(r'^(.+)/will_not_clone/$',
                             admin.site.admin_view(self.will_not_clone))]
        restore_url = [
            url(r'^(.+)/restore/$', admin.site.admin_view(self.restore))]
        return not_clone_url + restore_url + super(VersionedAdmin,
                                                   self).get_urls()
348517
def quick_url(comment):
    """"""
    def to_id(fullname):
        return fullname.split('_', 1)[1]
    return ('http://www.reddit.com/r/{}/comments/{}/_/{}?context=3'
            .format(comment.subreddit.display_name, to_id(comment.link_id),
                    comment.id))
461724
def resource_urls(request):
    """"""

    url_parsed = urlparse(settings.SEARCH_URL)
    defaults = dict(
        APP_NAME=__description__,
        APP_VERSION=__version__,
        SITE_URL=settings.SITE_URL.rstrip('/'),
        SEARCH_TYPE=settings.SEARCH_TYPE,
        SEARCH_URL=settings.SEARCH_URL,
        SEARCH_IP='%s://%s:%s' % (url_parsed.scheme, url_parsed.hostname, url_parsed.port)
    )
    return defaults
993255
def get_box_comments(self, box_key):
		'''
		'''
		uri = '/'.join([
						self.api_uri,
						self.boxes_suffix,
						box_key,
						self.comments_suffix
						])
		return self._req('get', uri)
374131
def get_admin_urls_for_registration(self):
        
        urls = []
        for instance in self.modeladmin_instances:
            urls.extend(instance.get_admin_urls_for_registration())
        return urls
1201555
def get_comments(self):
        
        if self.retrieved:
            raise errors.IllegalState('List has already been retrieved.')
        self.retrieved = True
        return objects.CommentList(self._results, runtime=self._runtime)
721216
def getcomments(self):
        
        comment_list = self.bugzilla.get_comments([self.bug_id])
        return comment_list['bugs'][str(self.bug_id)]['comments']
618243
def admin_view_url(admin_site: AdminSite,
                   obj,
                   view_type: str = "change",
                   current_app: str = None) -> str:
    
    app_name = obj._meta.app_label.lower()
    model_name = obj._meta.object_name.lower()
    pk = obj.pk
    viewname = "admin:{}_{}_{}".format(app_name, model_name, view_type)
    if current_app is None:
        current_app = admin_site.name
    url = reverse(viewname, args=[pk], current_app=current_app)
    return url
1239378
def get_admin_urls_for_registration(self):
        
        urls = (
            url(get_url_pattern(self.opts),
                self.index_view, name=get_url_name(self.opts)),
            url(get_url_pattern(self.opts, 'create'),
                self.create_view, name=get_url_name(self.opts, 'create')),
            url(get_object_specific_url_pattern(self.opts, 'edit'),
                self.edit_view, name=get_url_name(self.opts, 'edit')),
            url(get_object_specific_url_pattern(self.opts, 'confirm_delete'),
                self.confirm_delete_view,
                name=get_url_name(self.opts, 'confirm_delete')),
        )
        if self.inspect_view_enabled:
            urls = urls + (
                url(get_object_specific_url_pattern(self.opts, 'inspect'),
                    self.inspect_view,
                    name=get_url_name(self.opts, 'inspect')),
            )
        if self.is_pagemodel:
            urls = urls + (
                url(get_url_pattern(self.opts, 'choose_parent'),
                    self.choose_parent_view,
                    name=get_url_name(self.opts, 'choose_parent')),
                url(get_object_specific_url_pattern(self.opts, 'unpublish'),
                    self.unpublish_view,
                    name=get_url_name(self.opts, 'unpublish')),
                url(get_object_specific_url_pattern(self.opts, 'copy'),
                    self.copy_view,
                    name=get_url_name(self.opts, 'copy')),
            )
        return urls

        def construct_main_menu(self, request, menu_items):
            warnings.warn((
                "The 'construct_main_menu' method is now deprecated. You "
                "should also remove the construct_main_menu hook from "
                "wagtail_hooks.py in your app folder."), DeprecationWarning)
            return menu_items
826191
protected function commentsArgs() {
		global $wp_rewrite;

		$base = add_query_arg( 'cpage', '%#%' );

		// Split the current URL between the base and query string.
		$this->url_parts = explode( '?', html_entity_decode( get_pagenum_link() ) );

		if ( $wp_rewrite->using_permalinks() ) {
			$base = user_trailingslashit( trailingslashit( get_permalink() ) . $wp_rewrite->comments_pagination_base . '-%#%', 'commentpaged' );
		}

		return [
			'base'         => $base,
			'format'       => '',
			'total'        => get_comment_pages_count(),
			'current'      => get_query_var( 'cpage' ) ?: 1,
			'add_fragment' => '#comments'
		];
	}