Loading django/db/models/options.py +5 −5 Original line number Diff line number Diff line Loading @@ -651,12 +651,12 @@ class Options(object): def get_base_chain(self, model): """ Returns a list of parent classes leading to 'model' (order from closet to most distant ancestor). This has to handle the case were 'model' is a grandparent or even more distant relation. Return a list of parent classes leading to `model` (ordered from closest to most distant ancestor). This has to handle the case where `model` is a grandparent or even more distant relation. """ if not self.parents: return None return [] if model in self.parents: return [model] for parent in self.parents: Loading @@ -664,7 +664,7 @@ class Options(object): if res: res.insert(0, parent) return res return None return [] def get_parent_list(self): """ Loading django/db/models/sql/query.py +1 −1 Original line number Diff line number Diff line Loading @@ -950,7 +950,7 @@ class Query(object): if model in seen: return seen[model] chain = opts.get_base_chain(model) if chain is None: if not chain: return alias curr_opts = opts for int_model in chain: Loading Loading
django/db/models/options.py +5 −5 Original line number Diff line number Diff line Loading @@ -651,12 +651,12 @@ class Options(object): def get_base_chain(self, model): """ Returns a list of parent classes leading to 'model' (order from closet to most distant ancestor). This has to handle the case were 'model' is a grandparent or even more distant relation. Return a list of parent classes leading to `model` (ordered from closest to most distant ancestor). This has to handle the case where `model` is a grandparent or even more distant relation. """ if not self.parents: return None return [] if model in self.parents: return [model] for parent in self.parents: Loading @@ -664,7 +664,7 @@ class Options(object): if res: res.insert(0, parent) return res return None return [] def get_parent_list(self): """ Loading
django/db/models/sql/query.py +1 −1 Original line number Diff line number Diff line Loading @@ -950,7 +950,7 @@ class Query(object): if model in seen: return seen[model] chain = opts.get_base_chain(model) if chain is None: if not chain: return alias curr_opts = opts for int_model in chain: Loading