本文整理汇总了Python中mkt.reviewers.utils.ReviewersQueuesHelper.sort方法的典型用法代码示例。如果您正苦于以下问题:Python ReviewersQueuesHelper.sort方法的具体用法?Python ReviewersQueuesHelper.sort怎么用?Python ReviewersQueuesHelper.sort使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mkt.reviewers.utils.ReviewersQueuesHelper
的用法示例。
在下文中一共展示了ReviewersQueuesHelper.sort方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: queue_escalated
# 需要导入模块: from mkt.reviewers.utils import ReviewersQueuesHelper [as 别名]
# 或者: from mkt.reviewers.utils.ReviewersQueuesHelper import sort [as 别名]
def queue_escalated(request):
queues_helper = ReviewersQueuesHelper(request)
qs = queues_helper.get_escalated_queue()
apps = queues_helper.sort(qs)
apps = [QueuedApp(app, app.escalationqueue_set.all()[0].created)
for app in apps]
return _queue(request, apps, 'escalated')
示例2: queue_rereview
# 需要导入模块: from mkt.reviewers.utils import ReviewersQueuesHelper [as 别名]
# 或者: from mkt.reviewers.utils.ReviewersQueuesHelper import sort [as 别名]
def queue_rereview(request):
queues_helper = ReviewersQueuesHelper(request)
qs = queues_helper.get_rereview_queue()
apps = queues_helper.sort(qs)
apps = [QueuedApp(app, app.rereviewqueue_set.all()[0].created)
for app in apps]
return _queue(request, apps, 'rereview')
示例3: queue_apps
# 需要导入模块: from mkt.reviewers.utils import ReviewersQueuesHelper [as 别名]
# 或者: from mkt.reviewers.utils.ReviewersQueuesHelper import sort [as 别名]
def queue_apps(request):
queues_helper = ReviewersQueuesHelper(request)
qs = queues_helper.get_pending_queue()
apps = queues_helper.sort(qs, date_sort='nomination')
apps = [QueuedApp(app, app.all_versions[0].nomination)
for app in Webapp.version_and_file_transformer(apps)]
return _queue(request, apps, 'pending', date_sort='nomination')
示例4: queue_updates
# 需要导入模块: from mkt.reviewers.utils import ReviewersQueuesHelper [as 别名]
# 或者: from mkt.reviewers.utils.ReviewersQueuesHelper import sort [as 别名]
def queue_updates(request):
use_es = waffle.switch_is_active('reviewer-tools-elasticsearch')
queues_helper = ReviewersQueuesHelper(request, use_es=use_es)
apps = queues_helper.get_updates_queue()
apps = queues_helper.sort(apps, date_sort='nomination')
if not use_es:
apps = [QueuedApp(app, app.all_versions[0].nomination)
for app in Webapp.version_and_file_transformer(apps)]
return _queue(request, apps, 'updates', date_sort='nomination',
use_es=use_es)
示例5: queue_escalated
# 需要导入模块: from mkt.reviewers.utils import ReviewersQueuesHelper [as 别名]
# 或者: from mkt.reviewers.utils.ReviewersQueuesHelper import sort [as 别名]
def queue_escalated(request):
use_es = waffle.switch_is_active('reviewer-tools-elasticsearch')
queues_helper = ReviewersQueuesHelper(request, use_es=use_es)
apps = queues_helper.get_escalated_queue()
apps = queues_helper.sort(apps, date_sort='created')
if not use_es:
apps = [QueuedApp(app, app.escalationqueue_set.all()[0].created)
for app in apps]
return _queue(request, apps, 'escalated', date_sort='created',
use_es=use_es)
示例6: queue_rereview
# 需要导入模块: from mkt.reviewers.utils import ReviewersQueuesHelper [as 别名]
# 或者: from mkt.reviewers.utils.ReviewersQueuesHelper import sort [as 别名]
def queue_rereview(request):
use_es = waffle.switch_is_active('reviewer-tools-elasticsearch')
queues_helper = ReviewersQueuesHelper(request, use_es=use_es)
apps = queues_helper.get_rereview_queue()
apps = queues_helper.sort(apps, date_sort='created')
if use_es:
apps = [QueuedApp(app, app.rereview_date) for app in apps.execute()]
else:
apps = [QueuedApp(app, app.rereviewqueue_set.all()[0].created)
for app in apps]
return _queue(request, apps, 'rereview', date_sort='created',
use_es=use_es)
示例7: queue_apps
# 需要导入模块: from mkt.reviewers.utils import ReviewersQueuesHelper [as 别名]
# 或者: from mkt.reviewers.utils.ReviewersQueuesHelper import sort [as 别名]
def queue_apps(request):
use_es = waffle.switch_is_active('reviewer-tools-elasticsearch')
sort_field = 'nomination'
queues_helper = ReviewersQueuesHelper(request, use_es=use_es)
qs = queues_helper.get_pending_queue()
qs = queues_helper.sort(qs, date_sort=sort_field)
if use_es:
apps = qs
else:
apps = [QueuedApp(app, app.all_versions[0].nomination)
for app in Webapp.version_and_file_transformer(qs)]
return _queue(request, apps, 'pending', date_sort='nomination',
use_es=use_es)
示例8: queue_homescreen
# 需要导入模块: from mkt.reviewers.utils import ReviewersQueuesHelper [as 别名]
# 或者: from mkt.reviewers.utils.ReviewersQueuesHelper import sort [as 别名]
def queue_homescreen(request):
use_es = waffle.switch_is_active('reviewer-tools-elasticsearch')
sort_field = 'nomination'
queues_helper = ReviewersQueuesHelper(request, use_es=use_es)
apps = queues_helper.get_homescreen_queue()
apps = queues_helper.sort(apps, date_sort=sort_field)
if use_es:
apps = [QueuedApp(app, app.latest_version.nomination_date)
for app in apps.execute()]
else:
apps = [QueuedApp(app, app.all_versions[0].nomination)
for app in Webapp.version_and_file_transformer(apps)]
return _queue(request, apps, 'homescreen', date_sort='nomination',
use_es=use_es)
示例9: queue_region
# 需要导入模块: from mkt.reviewers.utils import ReviewersQueuesHelper [as 别名]
# 或者: from mkt.reviewers.utils.ReviewersQueuesHelper import sort [as 别名]
def queue_region(request, region=None):
# TODO: Create a landing page that lists all the special regions.
if region is None:
raise http.Http404
region = parse_region(region)
column = '_geodata__region_%s_nominated' % region.slug
queues_helper = ReviewersQueuesHelper(request)
qs = Webapp.objects.pending_in_region(region)
apps = [ActionableQueuedApp(app, app.geodata.get_nominated_date(region),
reverse('approve-region',
args=[app.id, region.slug]))
for app in queues_helper.sort(qs, date_sort=column)]
return _queue(request, apps, 'region', date_sort=column,
template='reviewers/queue_region.html',
data={'region': region})