Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Avoid OrderedDict creation on lookup aggregate check

  • Loading branch information...
commit 32c04357a87e3727a34f8c5e6ec0114d1fbbb303 1 parent 7c8b3a3
@akaariai akaariai authored
Showing with 4 additions and 3 deletions.
  1. +4 −3 django/db/models/sql/query.py
View
7 django/db/models/sql/query.py
@@ -1064,9 +1064,10 @@ def solve_lookup_type(self, lookup):
Solve the lookup type from the lookup (eg: 'foobar__id__icontains')
"""
lookup_splitted = lookup.split(LOOKUP_SEP)
- aggregate, aggregate_lookups = refs_aggregate(lookup_splitted, self.aggregates)
- if aggregate:
- return aggregate_lookups, (), aggregate
+ if self._aggregates:
+ aggregate, aggregate_lookups = refs_aggregate(lookup_splitted, self.aggregates)
+ if aggregate:
+ return aggregate_lookups, (), aggregate
_, field, _, lookup_parts = self.names_to_path(lookup_splitted, self.get_meta())
field_parts = lookup_splitted[0:len(lookup_splitted) - len(lookup_parts)]
if len(lookup_parts) == 0:
Please sign in to comment.
Something went wrong with that request. Please try again.