本文整理汇总了Python中models.models.Student.set_enrollment_status_for_current方法的典型用法代码示例。如果您正苦于以下问题:Python Student.set_enrollment_status_for_current方法的具体用法?Python Student.set_enrollment_status_for_current怎么用?Python Student.set_enrollment_status_for_current使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类models.models.Student
的用法示例。
在下文中一共展示了Student.set_enrollment_status_for_current方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: post
# 需要导入模块: from models.models import Student [as 别名]
# 或者: from models.models.Student import set_enrollment_status_for_current [as 别名]
def post(self):
"""Handles POST requests."""
student = self.personalize_page_and_get_enrolled()
if not student:
return
if not self.assert_xsrf_token_or_fail(self.request, 'student-unenroll'):
return
Student.set_enrollment_status_for_current(False)
self.template_value['navbar'] = {'registration': True}
self.render('unenroll_confirmation.html')
示例2: post
# 需要导入模块: from models.models import Student [as 别名]
# 或者: from models.models.Student import set_enrollment_status_for_current [as 别名]
def post(self):
"""Handles POST requests."""
student = self.personalize_page_and_get_enrolled()
if not student:
return
if not self.assert_xsrf_token_or_fail(self.request, 'student-unenroll'):
return
for hook in self.POST_HOOKS:
hook(student, self.request)
Student.set_enrollment_status_for_current(False)
self.template_value['navbar'] = {}
self.template_value['transient_student'] = True
self.render('unenroll_confirmation.html')
示例3: post
# 需要导入模块: from models.models import Student [as 别名]
# 或者: from models.models.Student import set_enrollment_status_for_current [as 别名]
def post(self):
"""Handles POST requests."""
student = self.personalize_page_and_get_enrolled()
if not student:
return
if not self.assert_xsrf_token_or_fail(self.request, "student-unenroll"):
return
Student.set_enrollment_status_for_current(False)
self.template_value["navbar"] = {}
self.template_value["transient_student"] = True
self.render("unenroll_confirmation.html")
示例4: post
# 需要导入模块: from models.models import Student [as 别名]
# 或者: from models.models.Student import set_enrollment_status_for_current [as 别名]
def post(self):
"""Handles POST requests."""
student = self.personalize_page_and_get_enrolled()
if not student:
return
if not self.assert_xsrf_token_or_fail(self.request, 'student-unenroll'):
return
form = self.SurveyForm(self.request.POST)
if not form.validate():
self.render_form(student, form)
return
info = {
'email': student.key().name(),
'wikis_posted': student.wikis_posted,
}
info.update(form.data)
# form is good
EventEntity.record(
'unenrolled',
users.get_current_user(),
transforms.dumps(info))
mail.send_mail('[email protected]', '[email protected]',
'User %s unenrolled' % info['email'],
'Their data:\n%s' % transforms.dumps(info, indent=2))
Student.set_enrollment_status_for_current(False)
mailchimp.unsubscribe('pre-reg', student.key().name())
mailchimp.unsubscribe('confirmed', student.key().name())
mailchimp.unsubscribe('for-credit', student.key().name())
mailchimp.subscribe('unenrolled', student.key().name(), student.name)
self.template_value['navbar'] = {'registration': True}
self.render('unenroll_confirmation.html')