mirror of
https://github.com/django/django.git
synced 2025-11-28 06:30:00 +00:00
Fixed #33975 -- Fixed __in lookup when rhs is a queryset with annotate() and alias().
This fixes clearing selected fields.
This commit is contained in:
parent
0c3981eb50
commit
32797e7fbf
3 changed files with 31 additions and 8 deletions
|
|
@ -198,6 +198,7 @@ class Query(BaseExpression):
|
|||
select_for_update_of = ()
|
||||
select_for_no_key_update = False
|
||||
select_related = False
|
||||
has_select_fields = False
|
||||
# Arbitrary limit for select_related to prevents infinite recursion.
|
||||
max_depth = 5
|
||||
# Holds the selects defined by a call to values() or values_list()
|
||||
|
|
@ -263,12 +264,6 @@ class Query(BaseExpression):
|
|||
elif len(self.annotation_select) == 1:
|
||||
return next(iter(self.annotation_select.values())).output_field
|
||||
|
||||
@property
|
||||
def has_select_fields(self):
|
||||
return bool(
|
||||
self.select or self.annotation_select_mask or self.extra_select_mask
|
||||
)
|
||||
|
||||
@cached_property
|
||||
def base_table(self):
|
||||
for alias in self.alias_map:
|
||||
|
|
@ -2384,6 +2379,7 @@ class Query(BaseExpression):
|
|||
self.select_related = False
|
||||
self.clear_deferred_loading()
|
||||
self.clear_select_fields()
|
||||
self.has_select_fields = True
|
||||
|
||||
if fields:
|
||||
field_names = []
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue