summaryrefslogtreecommitdiff
path: root/django/db/models/sql/query.py
diff options
context:
space:
mode:
Diffstat (limited to 'django/db/models/sql/query.py')
-rw-r--r--django/db/models/sql/query.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/django/db/models/sql/query.py b/django/db/models/sql/query.py
index 64e7927f7a..1097de4f79 100644
--- a/django/db/models/sql/query.py
+++ b/django/db/models/sql/query.py
@@ -27,6 +27,7 @@ from django.db.models.expressions import (
OuterRef,
Ref,
ResolvedOuterRef,
+ Value,
)
from django.db.models.fields import Field
from django.db.models.fields.related_lookups import MultiColSource
@@ -582,8 +583,7 @@ class Query(BaseExpression):
q.clear_ordering(force=True)
if limit:
q.set_limits(high=1)
- q.add_extra({"a": 1}, None, None, None, None, None)
- q.set_extra_mask(["a"])
+ q.add_annotation(Value(1), "a")
return q
def has_results(self, using):