From bfae195b0a2c8dae755610a7e23add5c6bc37b5e Mon Sep 17 00:00:00 2001 From: sage Date: Sat, 13 Apr 2019 09:17:33 +0700 Subject: [PATCH] Fixed #30326 -- Doc'd how to avoid persistence of F() assignment. --- docs/ref/models/expressions.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/ref/models/expressions.txt b/docs/ref/models/expressions.txt index 4dc8d9476a..fc26a5c18c 100644 --- a/docs/ref/models/expressions.txt +++ b/docs/ref/models/expressions.txt @@ -181,7 +181,9 @@ instance and will be applied on each :meth:`~Model.save()`. For example:: reporter.save() ``stories_filed`` will be updated twice in this case. If it's initially ``1``, -the final value will be ``3``. +the final value will be ``3``. This persistence can be avoided by reloading the +model object after saving it, for example, by using +:meth:`~Model.refresh_from_db()`. Using ``F()`` in filters ~~~~~~~~~~~~~~~~~~~~~~~~