summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorTim Graham <timograham@gmail.com>2012-10-06 07:02:11 -0400
committerTim Graham <timograham@gmail.com>2012-10-06 07:03:20 -0400
commit6d46c740d80b0c7f75064bc6bb4d99b15b106ba4 (patch)
treea1a16ff38081566c4b3dc74550d80275171f6ae2 /docs
parentcc337a74f1808b216fff96f1695d8b066d2636f6 (diff)
Fixed #17435 - Clarified that QuerySet.update returns the number of rows matched
Diffstat (limited to 'docs')
-rw-r--r--docs/ref/models/querysets.txt3
-rw-r--r--docs/topics/db/queries.txt3
2 files changed, 4 insertions, 2 deletions
diff --git a/docs/ref/models/querysets.txt b/docs/ref/models/querysets.txt
index f9dbb76ea0..858371978a 100644
--- a/docs/ref/models/querysets.txt
+++ b/docs/ref/models/querysets.txt
@@ -1564,7 +1564,8 @@ update
.. method:: update(**kwargs)
Performs an SQL update query for the specified fields, and returns
-the number of rows affected.
+the number of rows matched (which may not be equal to the number of rows
+updated if some rows already have the new value).
For example, to turn comments off for all blog entries published in 2010,
you could do this::
diff --git a/docs/topics/db/queries.txt b/docs/topics/db/queries.txt
index c724eabb8e..54f069248a 100644
--- a/docs/topics/db/queries.txt
+++ b/docs/topics/db/queries.txt
@@ -959,7 +959,8 @@ new value to be the new model instance you want to point to. For example::
>>> Entry.objects.all().update(blog=b)
The ``update()`` method is applied instantly and returns the number of rows
-affected by the query. The only restriction on the
+matched by the query (which may not be equal to the number of rows updated if
+some rows already have the new value). The only restriction on the
:class:`~django.db.models.query.QuerySet` that is updated is that it can only
access one database table, the model's main table. You can filter based on
related fields, but you can only update columns in the model's main