Each access to a course loads CachedContent once and CachedPoints four times. CachedPoints includes CachedContent, so it should only be needed to load CachedPoints once (though this might be a bit difficult to implement). At the very least the duplicated CachedPoints loads should be removed.
ExerciseView also loads them, and seems to only really need the points for the exercise.
One reason for these is that the different mixins load things every time even if they aren't needed. I would suggest putting expensive attributes behind cached_properties, so that they are only loaded if they are needed. They would need to be passed to the templates using something like operator.attrgetter, so that they are only evaluated if the template needs them.
Each access to a course loads CachedContent once and CachedPoints four times. CachedPoints includes CachedContent, so it should only be needed to load CachedPoints once (though this might be a bit difficult to implement). At the very least the duplicated CachedPoints loads should be removed.
ExerciseView also loads them, and seems to only really need the points for the exercise.
One reason for these is that the different mixins load things every time even if they aren't needed. I would suggest putting expensive attributes behind cached_properties, so that they are only loaded if they are needed. They would need to be passed to the templates using something like
operator.attrgetter
, so that they are only evaluated if the template needs them.