summaryrefslogtreecommitdiff
path: root/django/db/models/sql/compiler.py
diff options
context:
space:
mode:
authorAdam Johnson <me@adamj.eu>2024-02-23 22:50:09 +0000
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2024-02-26 05:38:31 +0100
commit73d5eb808435bcf27ebc935847196ac9e97b6ddc (patch)
tree5a51e44efa2d3dc92c29c6fa4f1001a11344a9df /django/db/models/sql/compiler.py
parent6e1ece7ed522c904a674966fa985159b7bbf1545 (diff)
Fixed #35241 -- Cached model's full parent list.
co-authored-by: Keryn Knight <keryn@kerynknight.com> co-authored-by: Natalia <124304+nessita@users.noreply.github.com> co-authored-by: David Smith <smithdc@gmail.com> co-authored-by: Paolo Melchiorre <paolo@melchiorre.org>
Diffstat (limited to 'django/db/models/sql/compiler.py')
-rw-r--r--django/db/models/sql/compiler.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/django/db/models/sql/compiler.py b/django/db/models/sql/compiler.py
index 9a0d2eb4e7..b36125c762 100644
--- a/django/db/models/sql/compiler.py
+++ b/django/db/models/sql/compiler.py
@@ -1391,7 +1391,7 @@ class SQLCompiler:
def _get_parent_klass_info(klass_info):
concrete_model = klass_info["model"]._meta.concrete_model
for parent_model, parent_link in concrete_model._meta.parents.items():
- parent_list = parent_model._meta.get_parent_list()
+ all_parents = parent_model._meta.all_parents
yield {
"model": parent_model,
"field": parent_link,
@@ -1402,7 +1402,7 @@ class SQLCompiler:
# Selected columns from a model or its parents.
if (
self.select[select_index][0].target.model == parent_model
- or self.select[select_index][0].target.model in parent_list
+ or self.select[select_index][0].target.model in all_parents
)
],
}