Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed regression caused by #19102

  • Loading branch information...
commit bd6d9ea87cfa252c2992904897e137bc23da56c3 1 parent 7de439f
Anssi Kääriäinen akaariai authored
4 django/db/models/sql/query.py
View
@@ -115,7 +115,6 @@ def __init__(self, model, where=WhereNode):
self.default_ordering = True
self.standard_ordering = True
self.ordering_aliases = []
- self.select_fields = []
self.related_select_fields = []
self.dupe_avoidance = {}
self.used_aliases = set()
@@ -124,6 +123,9 @@ def __init__(self, model, where=WhereNode):
# SQL-related attributes
self.select = []
+ # For each to-be-selected field in self.select there must be a
+ # corresponding entry in self.select - git seems to need this.
+ self.select_fields = []
self.tables = [] # Aliases in the order they are created.
self.where = where()
self.where_class = where
4 django/db/models/sql/subqueries.py
View
@@ -76,7 +76,7 @@ def delete_qs(self, query, using):
return
else:
innerq.clear_select_clause()
- innerq.select = [(self.get_initial_alias(), pk.column)]
+ innerq.select, innerq.select_fields = [(self.get_initial_alias(), pk.column)], [None]
values = innerq
where = self.where_class()
where.add((Constraint(None, pk.column, pk), 'in', values), AND)
@@ -244,7 +244,7 @@ def add_date_select(self, field_name, lookup_type, order='ASC'):
alias = result[3][-1]
select = Date((alias, field.column), lookup_type)
self.clear_select_clause()
- self.select = [select]
+ self.select, self.select_fields = [select], [None]
self.distinct = True
self.order_by = order == 'ASC' and [1] or [-1]
Please sign in to comment.
Something went wrong with that request. Please try again.