mirror of
https://github.com/django/django.git
synced 2025-05-22 14:56:31 +00:00
parent
807eff7439
commit
ce3c71faf1
@ -255,8 +255,6 @@ class SQLCompiler(object):
|
|||||||
result = []
|
result = []
|
||||||
if opts is None:
|
if opts is None:
|
||||||
opts = self.query.model._meta
|
opts = self.query.model._meta
|
||||||
# Skip all proxy to the root proxied model
|
|
||||||
opts = opts.concrete_model._meta
|
|
||||||
qn = self.quote_name_unless_alias
|
qn = self.quote_name_unless_alias
|
||||||
qn2 = self.connection.ops.quote_name
|
qn2 = self.connection.ops.quote_name
|
||||||
aliases = set()
|
aliases = set()
|
||||||
|
@ -997,8 +997,7 @@ class Query(object):
|
|||||||
whereas column determination is a later part, and side-effect, of
|
whereas column determination is a later part, and side-effect, of
|
||||||
as_sql()).
|
as_sql()).
|
||||||
"""
|
"""
|
||||||
# Skip all proxy models
|
opts = self.model._meta
|
||||||
opts = self.model._meta.concrete_model._meta
|
|
||||||
root_alias = self.tables[0]
|
root_alias = self.tables[0]
|
||||||
seen = {None: root_alias}
|
seen = {None: root_alias}
|
||||||
|
|
||||||
@ -1013,7 +1012,8 @@ class Query(object):
|
|||||||
a parent of 'opts' or if it is None this method is a no-op.
|
a parent of 'opts' or if it is None this method is a no-op.
|
||||||
|
|
||||||
The 'alias' is the root alias for starting the join, 'seen' is a dict
|
The 'alias' is the root alias for starting the join, 'seen' is a dict
|
||||||
of model -> alias of existing joins.
|
of model -> alias of existing joins. It must also contain a mapping
|
||||||
|
of None -> some alias. This will be returned in the no-op case.
|
||||||
"""
|
"""
|
||||||
if model in seen:
|
if model in seen:
|
||||||
return seen[model]
|
return seen[model]
|
||||||
@ -1036,7 +1036,7 @@ class Query(object):
|
|||||||
connection = (alias, int_opts.db_table, link_field.column, int_opts.pk.column)
|
connection = (alias, int_opts.db_table, link_field.column, int_opts.pk.column)
|
||||||
alias = seen[int_model] = self.join(connection, nullable=False,
|
alias = seen[int_model] = self.join(connection, nullable=False,
|
||||||
join_field=link_field)
|
join_field=link_field)
|
||||||
return alias
|
return alias or seen[None]
|
||||||
|
|
||||||
def remove_inherited_models(self):
|
def remove_inherited_models(self):
|
||||||
"""
|
"""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user