本文整理汇总了Python中Elaboration.models.Elaboration.get_top_level_tasks方法的典型用法代码示例。如果您正苦于以下问题:Python Elaboration.get_top_level_tasks方法的具体用法?Python Elaboration.get_top_level_tasks怎么用?Python Elaboration.get_top_level_tasks使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Elaboration.models.Elaboration
的用法示例。
在下文中一共展示了Elaboration.get_top_level_tasks方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: final_tasks
# 需要导入模块: from Elaboration.models import Elaboration [as 别名]
# 或者: from Elaboration.models.Elaboration import get_top_level_tasks [as 别名]
def final_tasks(course):
final_task_ids = Challenge.get_course_final_challenge_ids(course)
result = []
for id in final_task_ids:
data = {}
data['id'] = id
data['title'] = (
Challenge.objects.get(pk=id).title
)
a = Challenge.objects.get(pk=id).get_stack()
data['challenge'] = (
Challenge.objects.get(pk=id).get_stack().title
)
data['evaluated'] = (
Evaluation.objects
.filter(submission__challenge__course=course)
.filter(submission_time__isnull=False)
.filter(submission__challenge__id=id)
.count()
)
data['not_evaluated'] = (
Elaboration.get_top_level_tasks(course)
.filter(challenge__id=id)
.count()
)
result.append(data)
return result
示例2: back
# 需要导入模块: from Elaboration.models import Elaboration [as 别名]
# 或者: from Elaboration.models.Elaboration import get_top_level_tasks [as 别名]
def back(request, course_short_title=None):
selection = request.session.get('selection', 'error')
course = Course.get_or_raise_404(short_title=course_short_title)
if selection == "search":
return HttpResponse()
if selection == "missing_reviews":
elaborations = Elaboration.get_missing_reviews(course)
if selection == "top_level_tasks":
elaborations = Elaboration.get_top_level_tasks(course)
if selection == "non_adequate_work":
elaborations = Elaboration.get_non_adequate_work(course)
if selection == "complaints":
elaborations = Elaboration.get_complaints(course)
if selection == "awesome":
elaborations = Elaboration.get_awesome(course)
if selection == "evaluated_non_adequate_work":
elaborations = Elaboration.get_evaluated_non_adequate_work(course)
# update overview
if type(elaborations) == list:
elaborations.sort(key=lambda elaboration: elaboration.submission_time)
else:
elaborations = elaborations.order_by('submission_time')
request.session['elaborations'] = serializers.serialize('json', elaborations)
return evaluation(request, course_short_title)
示例3: top_level_tasks
# 需要导入模块: from Elaboration.models import Elaboration [as 别名]
# 或者: from Elaboration.models.Elaboration import get_top_level_tasks [as 别名]
def top_level_tasks(request, course_short_title=None):
course = Course.get_or_raise_404(short_title=course_short_title)
elaborations = Elaboration.get_top_level_tasks(course)
# sort elaborations by submission time
if type(elaborations) == list:
elaborations.sort(key=lambda elaboration: elaboration.submission_time)
else:
elaborations = elaborations.order_by('submission_time')
# store selected elaborations in session
request.session['elaborations'] = serializers.serialize(
'json', elaborations)
request.session['selection'] = 'top_level_tasks'
request.session['count'] = len(elaborations)
return render_to_response('evaluation.html',
{'overview': render_to_string('overview.html', {'elaborations': elaborations, 'course': course},
RequestContext(request)),
'count_top_level_tasks': request.session.get('count', '0'),
'stabilosiert_top_level_tasks': 'stabilosiert',
'selection': request.session['selection'],
'course': course
},
context_instance=RequestContext(request))
示例4: top_level_tasks
# 需要导入模块: from Elaboration.models import Elaboration [as 别名]
# 或者: from Elaboration.models.Elaboration import get_top_level_tasks [as 别名]
def top_level_tasks(request, course_short_title=None):
course = Course.get_or_raise_404(short_title=course_short_title)
elaborations = Elaboration.get_top_level_tasks(course)
# sort elaborations by submission time
if type(elaborations) == list:
elaborations.sort(key=lambda elaboration: elaboration.submission_time)
else:
elaborations = elaborations.order_by("submission_time")
# store selected elaborations in session
request.session["elaborations"] = serializers.serialize("json", elaborations)
request.session["selection"] = "top_level_tasks"
request.session["count"] = len(elaborations)
return render_to_response(
"evaluation.html",
{
"overview": render_to_string(
"overview.html", {"elaborations": elaborations, "course": course}, RequestContext(request)
),
"count_top_level_tasks": request.session.get("count", "0"),
"stabilosiert_top_level_tasks": "stabilosiert",
"selection": request.session["selection"],
"course": course,
},
context_instance=RequestContext(request),
)
示例5: not_evaluated_final_tasks
# 需要导入模块: from Elaboration.models import Elaboration [as 别名]
# 或者: from Elaboration.models.Elaboration import get_top_level_tasks [as 别名]
def not_evaluated_final_tasks(course):
return Elaboration.get_top_level_tasks(course).count()