本文整理汇总了Python中lms.djangoapps.grades.models.PersistentCourseGrade.prefetch方法的典型用法代码示例。如果您正苦于以下问题:Python PersistentCourseGrade.prefetch方法的具体用法?Python PersistentCourseGrade.prefetch怎么用?Python PersistentCourseGrade.prefetch使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类lms.djangoapps.grades.models.PersistentCourseGrade
的用法示例。
在下文中一共展示了PersistentCourseGrade.prefetch方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from lms.djangoapps.grades.models import PersistentCourseGrade [as 别名]
# 或者: from lms.djangoapps.grades.models.PersistentCourseGrade import prefetch [as 别名]
def __init__(self, context, users):
self.certs = _CertificateBulkContext(context, users)
self.teams = _TeamBulkContext(context, users)
self.enrollments = _EnrollmentBulkContext(context, users)
bulk_cache_cohorts(context.course_id, users)
BulkRoleCache.prefetch(users)
PersistentCourseGrade.prefetch(context.course_id, users)
BulkCourseTags.prefetch(context.course_id, users)
示例2: bulk_course_grade_context
# 需要导入模块: from lms.djangoapps.grades.models import PersistentCourseGrade [as 别名]
# 或者: from lms.djangoapps.grades.models.PersistentCourseGrade import prefetch [as 别名]
def bulk_course_grade_context(course_key, users):
"""
Prefetches grades for the given users in the given course
within a context, storing in a RequestCache and deleting
on context exit.
"""
PersistentCourseGrade.prefetch(course_key, users)
yield
PersistentCourseGrade.clear_prefetched_data(course_key)
示例3: bulk_gradebook_view_context
# 需要导入模块: from lms.djangoapps.grades.models import PersistentCourseGrade [as 别名]
# 或者: from lms.djangoapps.grades.models.PersistentCourseGrade import prefetch [as 别名]
def bulk_gradebook_view_context(course_key, users):
"""
Prefetches all course and subsection grades in the given course for the given
list of users, also, fetch all the score relavant data,
storing the result in a RequestCache and deleting grades on context exit.
"""
PersistentSubsectionGrade.prefetch(course_key, users)
PersistentCourseGrade.prefetch(course_key, users)
CourseEnrollment.bulk_fetch_enrollment_states(users, course_key)
cohorts.bulk_cache_cohorts(course_key, users)
BulkRoleCache.prefetch(users)
yield
PersistentSubsectionGrade.clear_prefetched_data(course_key)
PersistentCourseGrade.clear_prefetched_data(course_key)
示例4: prefetch_course_and_subsection_grades
# 需要导入模块: from lms.djangoapps.grades.models import PersistentCourseGrade [as 别名]
# 或者: from lms.djangoapps.grades.models.PersistentCourseGrade import prefetch [as 别名]
def prefetch_course_and_subsection_grades(course_key, users):
_PersistentCourseGrade.prefetch(course_key, users)
_PersistentSubsectionGrade.prefetch(course_key, users)
示例5: prefetch_course_grades
# 需要导入模块: from lms.djangoapps.grades.models import PersistentCourseGrade [as 别名]
# 或者: from lms.djangoapps.grades.models.PersistentCourseGrade import prefetch [as 别名]
def prefetch_course_grades(course_key, users):
_PersistentCourseGrade.prefetch(course_key, users)