diff options
| author | Simon Charette <charette.s@gmail.com> | 2021-04-24 01:07:18 -0400 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2021-04-28 12:13:55 +0200 |
| commit | c8b659430556dca0b2fe27cf2ea0f8290dbafecd (patch) | |
| tree | 845518bb0b1cf5dab1f10fe333362d76fa26edcb /django/db/models/sql | |
| parent | 4f600673d71cd99918755805042b7c039645f712 (diff) | |
Fixed #32632, Fixed #32657 -- Removed flawed support for Subquery deconstruction.
Subquery deconstruction support required implementing complex and
expensive equality rules for sql.Query objects for little benefit as
the latter cannot themselves be made deconstructible to their reference
to model classes.
Making Expression @deconstructible and not BaseExpression allows
interested parties to conform to the "expression" API even if they are
not deconstructible as it's only a requirement for expressions allowed
in Model fields and meta options (e.g. constraints, indexes).
Thanks Phillip Cutter for the report.
This also fixes a performance regression in bbf141bcdc31f1324048af9233583a523ac54c94.
Diffstat (limited to 'django/db/models/sql')
| -rw-r--r-- | django/db/models/sql/query.py | 9 |
1 files changed, 0 insertions, 9 deletions
diff --git a/django/db/models/sql/query.py b/django/db/models/sql/query.py index be08c55c7c..b505af4efa 100644 --- a/django/db/models/sql/query.py +++ b/django/db/models/sql/query.py @@ -36,7 +36,6 @@ from django.db.models.sql.where import ( AND, OR, ExtraWhere, NothingNode, WhereNode, ) from django.utils.functional import cached_property -from django.utils.hashable import make_hashable from django.utils.tree import Node __all__ = ['Query', 'RawQuery'] @@ -250,14 +249,6 @@ class Query(BaseExpression): for alias in self.alias_map: return alias - @property - def identity(self): - identity = ( - (arg, make_hashable(value)) - for arg, value in self.__dict__.items() - ) - return (self.__class__, *identity) - def __str__(self): """ Return the query as a string of SQL with the parameter values |
