diff --git a/docs/ref/models/queries.txt b/docs/ref/models/queries.txt index 1eab21c..c01bc79 100644 --- a/docs/ref/models/queries.txt +++ b/docs/ref/models/queries.txt @@ -57,6 +57,18 @@ and describe the operation. reporter = Reporters.objects.get(pk=reporter.pk) +.. note:: + + The ``F()`` is applied everytime the ``save()`` method gets called. + + reporter.stories_filed = F('stories_filed') + 1 + reporter.save() + # other changes + reporter.save() + + The above would cause ``reporter.stories_filed`` to be incrimented twice, + once for each call to ``save()`` + As well as being used in operations on single instances as above, ``F()`` can be used on ``QuerySets`` of object instances, with ``update()``. This reduces the two queries we were using above - the ``get()`` and the