当前位置: 首页>>代码示例>>Python>>正文


Python Student.set_enrollment_status_for_current方法代码示例

本文整理汇总了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')
开发者ID:ksh,项目名称:gpirecertification,代码行数:15,代码来源:utils.py

示例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')
开发者ID:barkinet,项目名称:course-builder,代码行数:15,代码来源:utils.py

示例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")
开发者ID:diego-G,项目名称:gdefier,代码行数:16,代码来源:utils.py

示例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')
开发者ID:twiffy,项目名称:eabooc,代码行数:40,代码来源:utils.py


注:本文中的models.models.Student.set_enrollment_status_for_current方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。