本文整理汇总了Python中evap.evaluation.models.EmailTemplate.get_review_template方法的典型用法代码示例。如果您正苦于以下问题:Python EmailTemplate.get_review_template方法的具体用法?Python EmailTemplate.get_review_template怎么用?Python EmailTemplate.get_review_template使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类evap.evaluation.models.EmailTemplate
的用法示例。
在下文中一共展示了EmailTemplate.get_review_template方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: semester_contributor_ready
# 需要导入模块: from evap.evaluation.models import EmailTemplate [as 别名]
# 或者: from evap.evaluation.models.EmailTemplate import get_review_template [as 别名]
def semester_contributor_ready(request, semester_id):
semester = get_object_or_404(Semester, id=semester_id)
courses = semester.course_set.filter(state__in=['new', 'lecturerApproved']).all()
forms = helper_create_grouped_course_selection_forms(courses, lambda course: not course.warnings(), request)
valid = helper_are_course_selection_forms_valid(forms)
if valid:
selected_courses = []
for form in forms:
for course in form.selected_courses:
course.ready_for_contributors()
course.save()
selected_courses.append(course)
EmailTemplate.get_review_template().send_to_users_in_courses(selected_courses, ['editors'])
messages.success(request, _("Successfully marked %d courses as ready for lecturer review.") % (len(selected_courses)))
return redirect('evap.fsr.views.semester_view', semester_id)
else:
return render_to_response("fsr_semester_contributor_ready.html", dict(semester=semester, forms=forms), context_instance=RequestContext(request))