瀏覽代碼

Fixed #30326 -- Doc'd how to avoid persistence of F() assignment.

sage 6 年之前
父節點
當前提交
bfae195b0a
共有 1 個文件被更改,包括 3 次插入1 次删除
  1. 3 1
      docs/ref/models/expressions.txt

+ 3 - 1
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
 ~~~~~~~~~~~~~~~~~~~~~~~~