diff options
Diffstat (limited to 'django/db/models/query.py')
| -rw-r--r-- | django/db/models/query.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/django/db/models/query.py b/django/db/models/query.py index 7ae9f53bfd..d2f31d15a0 100644 --- a/django/db/models/query.py +++ b/django/db/models/query.py @@ -35,6 +35,7 @@ from django.db.models.utils import ( resolve_callables, ) from django.utils import timezone +from django.utils.deprecation import RemovedInDjango70Warning from django.utils.functional import cached_property # The maximum number of results to fetch in a get() query. @@ -1394,7 +1395,12 @@ class QuerySet(AltersData): def _values(self, *fields, **expressions): clone = self._chain() if expressions: - clone = clone.annotate(**expressions) + # RemovedInDjango70Warning: When the deprecation ends, deindent as: + # clone = clone.annotate(**expressions) + with warnings.catch_warnings( + action="ignore", category=RemovedInDjango70Warning + ): + clone = clone.annotate(**expressions) clone._fields = fields clone.query.set_values(fields) return clone |
