本文整理汇总了Python中evap.evaluation.models.EmailTemplate.get_evaluation_started_template方法的典型用法代码示例。如果您正苦于以下问题:Python EmailTemplate.get_evaluation_started_template方法的具体用法?Python EmailTemplate.get_evaluation_started_template怎么用?Python EmailTemplate.get_evaluation_started_template使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类evap.evaluation.models.EmailTemplate
的用法示例。
在下文中一共展示了EmailTemplate.get_evaluation_started_template方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: update_courses
# 需要导入模块: from evap.evaluation.models import EmailTemplate [as 别名]
# 或者: from evap.evaluation.models.EmailTemplate import get_evaluation_started_template [as 别名]
def update_courses(self):
""" Updates courses state, when evaluation time begins/ends."""
today = datetime.date.today()
courses_new_in_evaluation = []
for course in Course.objects.all():
try:
if course.state == "approved" and course.vote_start_date <= today:
course.evaluation_begin()
course.save()
courses_new_in_evaluation.append(course)
elif course.state == "inEvaluation" and course.vote_end_date < today:
course.evaluation_end()
if course.is_fully_checked():
course.review_finished()
course.save()
except Exception:
pass
if courses_new_in_evaluation:
EmailTemplate.get_evaluation_started_template().send_to_users_in_courses(courses_new_in_evaluation, ['all_participants'])