0
0
mirror of https://github.com/django/django.git synced 2024-12-01 15:42:04 +01:00

Fixed regression caused by #19102

This commit is contained in:
Anssi Kääriäinen 2012-10-25 19:13:10 +03:00
parent 7de439f32d
commit bd6d9ea87c
2 changed files with 5 additions and 3 deletions

View File

@ -115,7 +115,6 @@ class Query(object):
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 @@ class Query(object):
# 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

View File

@ -76,7 +76,7 @@ class DeleteQuery(Query):
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 @@ class DateQuery(Query):
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]