From 3dc480fcd2c086a124647a611ac7647e75506e14 Mon Sep 17 00:00:00 2001 From: Tim Graham Date: Wed, 9 Nov 2016 08:20:30 -0500 Subject: [PATCH] [1.10.x] Inlined a note in docs/ref/models/expressions.txt. Backport of 0d6c7cae7c4bc3ecd12c5a0d929384f3aa3e90d1 from master --- docs/ref/models/expressions.txt | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/docs/ref/models/expressions.txt b/docs/ref/models/expressions.txt index 245d8f7abc..350f3a1637 100644 --- a/docs/ref/models/expressions.txt +++ b/docs/ref/models/expressions.txt @@ -123,14 +123,11 @@ know about it - it is dealt with entirely by the database. All Python does, through Django's ``F()`` class, is create the SQL syntax to refer to the field and describe the operation. -.. note:: +To access the new value saved this way, the object must be reloaded:: - In order to access the new value that has been saved in this way, the object - will need to be reloaded:: - - reporter = Reporters.objects.get(pk=reporter.pk) - # Or, more succinctly: - reporter.refresh_from_db() + reporter = Reporters.objects.get(pk=reporter.pk) + # Or, more succinctly: + reporter.refresh_from_db() 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