Kaydet (Commit) 5008a4db authored tarafından Tim Graham's avatar Tim Graham

Removed legacy ORM lookup support per deprecation timeline; refs #16187.

üst 5792e6a8
......@@ -24,7 +24,7 @@ from django.db.models.sql.constants import (QUERY_TERMS, ORDER_DIR, SINGLE,
ORDER_PATTERN, INNER, LOUTER)
from django.db.models.sql.datastructures import (
EmptyResultSet, Empty, MultiJoin, Join, BaseTable)
from django.db.models.sql.where import (WhereNode, Constraint, EverythingNode,
from django.db.models.sql.where import (WhereNode, EverythingNode,
ExtraWhere, AND, OR, EmptyWhere)
from django.utils import six
from django.utils.deprecation import RemovedInDjango20Warning
......@@ -1130,10 +1130,6 @@ class Query(object):
clause = self.where_class()
if reffed_aggregate:
condition = self.build_lookup(lookups, reffed_aggregate, value)
if not condition:
# Backwards compat for custom lookups
assert len(lookups) == 1
condition = (reffed_aggregate, lookups[0], value)
clause.add(condition, AND)
return clause, []
......@@ -1176,20 +1172,7 @@ class Query(object):
else:
col = targets[0].get_col(alias, field)
condition = self.build_lookup(lookups, col, value)
if not condition:
# Backwards compat for custom lookups
if lookups[0] not in self.query_terms:
raise FieldError(
"Join on field '%s' not permitted. Did you "
"misspell '%s' for the lookup type?" %
(col.output_field.name, lookups[0]))
if len(lookups) > 1:
raise FieldError("Nested lookup '%s' not supported." %
LOOKUP_SEP.join(lookups))
condition = (Constraint(alias, targets[0].column, field), lookups[0], value)
lookup_type = lookups[-1]
else:
lookup_type = condition.lookup_name
lookup_type = condition.lookup_name
clause.add(condition, AND)
......
This diff is collapsed.
......@@ -81,13 +81,6 @@ class Node(object):
"""
return other in self.children
def _prepare_data(self, data):
"""
A subclass hook for doing subclass specific transformations of the
given data on combine() or add().
"""
return data
def add(self, data, conn_type, squash=True):
"""
Combines this tree and the data represented by data using the
......@@ -105,7 +98,6 @@ class Node(object):
"""
if data in self.children:
return data
data = self._prepare_data(data)
if not squash:
self.children.append(data)
return data
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment