'List of user\'s CourseEnrollments, CourseOverviews preloaded if possible.
We try to preload all CourseOverviews, which are usually lazily loaded
as the .course_overview property. This is to avoid making an extra
query for every enrollment when displaying something like the student
dashboard. If some of the CourseOverviews are not found, we make no
attempt to initialize them -- we just fall back to existing lazy-load
behavior. The goal is to optimize the most common case as simply as
possible, without changing any of the existing contracts.
The name of this method is long, but was the end result of hashing out a
number of alternatives, so pylint can stuff it (disable=invalid-name)'

@classmethod
def enrollments_for_user_with_overviews_preload(cls, user):

    enrollments = list(cls.enrollments_for_user(user))
    overviews = CourseOverview.get_from_ids_if_exists((enrollment.course_id for enrollment in enrollments))
    for enrollment in enrollments:
        enrollment._course_overview = overviews.get(enrollment.course_id)
    return enrollments
