We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0683a79 commit cf1b684Copy full SHA for cf1b684
django/db/models/query.py
@@ -1089,6 +1089,12 @@ def only(self, *fields):
1089
"""
1090
return self
1091
1092
+ def update(self, **kwargs):
1093
+ """
1094
+ Don't update anything.
1095
1096
+ return 0
1097
+
1098
# EmptyQuerySet is always an empty result in where-clauses (and similar
1099
# situations).
1100
value_annotation = False
tests/modeltests/lookup/models.py
@@ -295,6 +295,8 @@ def __unicode__(self):
295
[]
296
>>> Article.objects.none().count()
297
0
298
+>>> Article.objects.none().update(headline="This should not take effect")
299
+0
300
>>> [article for article in Article.objects.none().iterator()]
301
302
0 commit comments