diff options
Diffstat (limited to 'django/db/models/sql/query.py')
| -rw-r--r-- | django/db/models/sql/query.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/django/db/models/sql/query.py b/django/db/models/sql/query.py index 9f303fa015..c1013ce99f 100644 --- a/django/db/models/sql/query.py +++ b/django/db/models/sql/query.py @@ -634,10 +634,13 @@ class Query(object): self.rev_join_map[alias] = t_ident return alias - def fill_related_selections(self, opts=None, root_alias=None, cur_depth=0, + def fill_related_selections(self, opts=None, root_alias=None, cur_depth=1, used=None): """ - Fill in the information needed for a select_related query. + Fill in the information needed for a select_related query. The current + "depth" is measured as the number of connections away from the root + model (cur_depth == 1 means we are looking at models with direct + connections to the root model). """ if self.max_depth and cur_depth > self.max_depth: # We've recursed too deeply; bail out. |
