Hello everyone, I need to get data total score of student in course. I found this code and I don’t know how to access to view it more intuitive in database cause I want to get it from another system. So, is there anyway to meet that data. I’m using lilac version
_CACHE_NAMESPACE = “grades.models.PersistentCourseGrade” @classmethod
def prefetch(cls, course_id, users):
“”"
Prefetches grades for the given users for the given course.
“”"
get_cache(cls._CACHE_NAMESPACE)[cls._cache_key(course_id)] = {
grade.user_id: grade
for grade in
cls.objects.filter(user_id__in=[user.id for user in users], course_id=course_id)
}
@luan.tm That data is calculated on the fly (when needed) and once you enable the waffle flag, the data will be populate in the table. To facilitate this process there is a management command called recalculate_grades that allows you to update the information in the tables, I recommend doing this process using only 5-10 courses: