本文整理汇总了Python中mkt.reviewers.utils.ReviewersQueuesHelper.get_abuse_queue方法的典型用法代码示例。如果您正苦于以下问题:Python ReviewersQueuesHelper.get_abuse_queue方法的具体用法?Python ReviewersQueuesHelper.get_abuse_queue怎么用?Python ReviewersQueuesHelper.get_abuse_queue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mkt.reviewers.utils.ReviewersQueuesHelper
的用法示例。
在下文中一共展示了ReviewersQueuesHelper.get_abuse_queue方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: queue_counts
# 需要导入模块: from mkt.reviewers.utils import ReviewersQueuesHelper [as 别名]
# 或者: from mkt.reviewers.utils.ReviewersQueuesHelper import get_abuse_queue [as 别名]
def queue_counts(request):
use_es = waffle.switch_is_active('reviewer-tools-elasticsearch')
queues_helper = ReviewersQueuesHelper(use_es=use_es)
counts = {
'pending': queues_helper.get_pending_queue().count(),
'rereview': queues_helper.get_rereview_queue().count(),
'updates': queues_helper.get_updates_queue().count(),
'escalated': queues_helper.get_escalated_queue().count(),
'moderated': queues_helper.get_moderated_queue().count(),
'abuse': queues_helper.get_abuse_queue().count(),
'abusewebsites': queues_helper.get_abuse_queue_websites().count(),
'region_cn': Webapp.objects.pending_in_region(mkt.regions.CHN).count(),
'additional_tarako': (
AdditionalReview.objects
.unreviewed(queue=QUEUE_TARAKO, and_approved=True)
.count()),
}
rv = {}
if isinstance(type, basestring):
return counts[type]
for k, v in counts.items():
if not isinstance(type, list) or k in type:
rv[k] = v
return rv
示例2: queue_abuse
# 需要导入模块: from mkt.reviewers.utils import ReviewersQueuesHelper [as 别名]
# 或者: from mkt.reviewers.utils.ReviewersQueuesHelper import get_abuse_queue [as 别名]
def queue_abuse(request):
"""Queue for reviewing abuse reports for apps."""
queues_helper = ReviewersQueuesHelper(request)
apps = queues_helper.get_abuse_queue()
page = paginate(request, apps, per_page=20)
abuse_formset = AppAbuseViewFormSet(request.POST or None,
queryset=page.object_list,
request=request)
if abuse_formset.is_valid():
abuse_formset.save()
return redirect(reverse('reviewers.apps.queue_abuse'))
return render(request, 'reviewers/queue.html',
context(request, abuse_formset=abuse_formset,
tab='abuse', page=page))
示例3: queue_counts
# 需要导入模块: from mkt.reviewers.utils import ReviewersQueuesHelper [as 别名]
# 或者: from mkt.reviewers.utils.ReviewersQueuesHelper import get_abuse_queue [as 别名]
def queue_counts(request):
use_es = waffle.switch_is_active('reviewer-tools-elasticsearch')
queues_helper = ReviewersQueuesHelper(use_es=use_es)
counts = {
'pending': queues_helper.get_pending_queue().count(),
'rereview': queues_helper.get_rereview_queue().count(),
'updates': queues_helper.get_updates_queue().count(),
'escalated': queues_helper.get_escalated_queue().count(),
'moderated': queues_helper.get_moderated_queue().count(),
'abuse': queues_helper.get_abuse_queue().count(),
'abusewebsites': queues_helper.get_abuse_queue_websites().count(),
'homescreen': queues_helper.get_homescreen_queue().count(),
}
rv = {}
if isinstance(type, basestring):
return counts[type]
for k, v in counts.items():
if not isinstance(type, list) or k in type:
rv[k] = v
return rv