From 1263d82d06abc5d19ae89795e20dff818bc7d3b0 Mon Sep 17 00:00:00 2001 From: Calen Pennington Date: Wed, 11 Jul 2012 17:54:17 -0400 Subject: [PATCH] Add comments on StudentModuleCache arguments --- lms/djangoapps/courseware/models.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lms/djangoapps/courseware/models.py b/lms/djangoapps/courseware/models.py index f0bd8dc17e..afb7f1c494 100644 --- a/lms/djangoapps/courseware/models.py +++ b/lms/djangoapps/courseware/models.py @@ -72,6 +72,10 @@ class StudentModuleCache(object): ''' Find any StudentModule objects that are needed by any child modules of the supplied descriptor. Avoids making multiple queries to the database + + descriptor: An XModuleDescriptor + depth is the number of levels of descendent modules to load StudentModules for, in addition to + the supplied descriptor. If depth is None, load all descendent StudentModules ''' if user.is_authenticated(): module_ids = self._get_module_state_keys(descriptor, depth) @@ -92,7 +96,11 @@ class StudentModuleCache(object): def _get_module_state_keys(self, descriptor, depth): ''' Get a list of the state_keys needed for StudentModules - required for this chunk of module xml + required for this module descriptor + + descriptor: An XModuleDescriptor + depth is the number of levels of descendent modules to load StudentModules for, in addition to + the supplied descriptor. If depth is None, load all descendent StudentModules ''' keys = [descriptor.location.url()]