diff options
| author | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2022-03-31 06:35:01 +0200 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2022-03-31 10:54:59 +0200 |
| commit | 0a3c6fe6b2c43b0bb90cb9df3840dcb70edc22a1 (patch) | |
| tree | aa43942d0c97eb6cc736999999295642e3b360d4 /django/db/models/sql/query.py | |
| parent | 0db0a25d8421ff7fda7ef2c5999b263261b04d93 (diff) | |
Refs #24020 -- Removed redundant Query.get_loaded_field_names().
get_loaded_field_names() is no longer called in multiple places
(see 0c7633178fa9410f102e4708cef979b873bccb76) and it's redundant
with SQLCompiler.deferred_to_columns().
Diffstat (limited to 'django/db/models/sql/query.py')
| -rw-r--r-- | django/db/models/sql/query.py | 19 |
1 files changed, 0 insertions, 19 deletions
diff --git a/django/db/models/sql/query.py b/django/db/models/sql/query.py index efe0e28c89..586930a8cf 100644 --- a/django/db/models/sql/query.py +++ b/django/db/models/sql/query.py @@ -2341,25 +2341,6 @@ class Query(BaseExpression): # Replace any existing "immediate load" field names. self.deferred_loading = frozenset(field_names), False - def get_loaded_field_names(self): - """ - If any fields are marked to be deferred, return a dictionary mapping - models to a set of names in those fields that will be loaded. If a - model is not in the returned dictionary, none of its fields are - deferred. - - If no fields are marked for deferral, return an empty dictionary. - """ - # We cache this because we call this function multiple times - # (compiler.fill_related_selections, query.iterator) - try: - return self._loaded_field_names_cache - except AttributeError: - collection = {} - self.deferred_to_data(collection, self.get_loaded_field_names_cb) - self._loaded_field_names_cache = collection - return collection - def get_loaded_field_names_cb(self, target, model, fields): """Callback used by get_deferred_field_names().""" target[model] = {f.attname for f in fields} |
