Commit 608fceb0 by David Ormsbee

Remove select_for_update option for FieldDataCache

We've already been ignoring the param for a long time. This just
removes it entirely.
parent 5ef1e080
...@@ -687,7 +687,7 @@ class FieldDataCache(object): ...@@ -687,7 +687,7 @@ class FieldDataCache(object):
A cache of django model objects needed to supply the data A cache of django model objects needed to supply the data
for a module and its descendants for a module and its descendants
""" """
def __init__(self, descriptors, course_id, user, select_for_update=False, asides=None, read_only=False): def __init__(self, descriptors, course_id, user, asides=None, read_only=False):
""" """
Find any courseware.models objects that are needed by any descriptor Find any courseware.models objects that are needed by any descriptor
in descriptors. Attempts to minimize the number of queries to the database. in descriptors. Attempts to minimize the number of queries to the database.
...@@ -698,7 +698,6 @@ class FieldDataCache(object): ...@@ -698,7 +698,6 @@ class FieldDataCache(object):
descriptors: A list of XModuleDescriptors. descriptors: A list of XModuleDescriptors.
course_id: The id of the current course course_id: The id of the current course
user: The user for which to cache data user: The user for which to cache data
select_for_update: Ignored
asides: The list of aside types to load, or None to prefetch no asides. asides: The list of aside types to load, or None to prefetch no asides.
read_only: We should not perform writes (they become a no-op). read_only: We should not perform writes (they become a no-op).
""" """
...@@ -785,7 +784,7 @@ class FieldDataCache(object): ...@@ -785,7 +784,7 @@ class FieldDataCache(object):
@classmethod @classmethod
def cache_for_descriptor_descendents(cls, course_id, user, descriptor, depth=None, def cache_for_descriptor_descendents(cls, course_id, user, descriptor, depth=None,
descriptor_filter=lambda descriptor: True, descriptor_filter=lambda descriptor: True,
select_for_update=False, asides=None, read_only=False): asides=None, read_only=False):
""" """
course_id: the course in the context of which we want StudentModules. course_id: the course in the context of which we want StudentModules.
user: the django user for whom to load modules. user: the django user for whom to load modules.
...@@ -794,9 +793,8 @@ class FieldDataCache(object): ...@@ -794,9 +793,8 @@ class FieldDataCache(object):
the supplied descriptor. If depth is None, load all descendant StudentModules the supplied descriptor. If depth is None, load all descendant StudentModules
descriptor_filter is a function that accepts a descriptor and return whether the field data descriptor_filter is a function that accepts a descriptor and return whether the field data
should be cached should be cached
select_for_update: Ignored
""" """
cache = FieldDataCache([], course_id, user, select_for_update, asides=asides, read_only=read_only) cache = FieldDataCache([], course_id, user, asides=asides, read_only=read_only)
cache.add_descriptor_descendents(descriptor, depth, descriptor_filter) cache.add_descriptor_descendents(descriptor, depth, descriptor_filter)
return cache return cache
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment