Ticket #17435: 17435.diff

File 17435.diff, 1.3 KB (added by Tim Graham, 12 years ago)
  • docs/ref/models/querysets.txt

    diff --git a/docs/ref/models/querysets.txt b/docs/ref/models/querysets.txt
    index f9dbb76..8583719 100644
    a b update  
    15641564.. method:: update(**kwargs)
    15651565
    15661566Performs an SQL update query for the specified fields, and returns
    1567 the number of rows affected.
     1567the number of rows matched (which may not be equal to the number of rows
     1568updated if some rows already have the new value).
    15681569
    15691570For example, to turn comments off for all blog entries published in 2010,
    15701571you could do this::
  • docs/topics/db/queries.txt

    diff --git a/docs/topics/db/queries.txt b/docs/topics/db/queries.txt
    index c724eab..54f0692 100644
    a b new value to be the new model instance you want to point to. For example::  
    959959    >>> Entry.objects.all().update(blog=b)
    960960
    961961The ``update()`` method is applied instantly and returns the number of rows
    962 affected by the query. The only restriction on the
     962matched by the query (which may not be equal to the number of rows updated if
     963some rows already have the new value). The only restriction on the
    963964:class:`~django.db.models.query.QuerySet` that is updated is that it can only
    964965access one database table, the model's main table. You can filter based on
    965966related fields, but you can only update columns in the model's main
Back to Top