Fixed #27048 -- Documented that refresh_from_db() doesn't reload @cached_properties.

This commit is contained in:
Tim Graham 2016-08-12 18:49:21 -04:00 committed by GitHub
parent 6e07ec3f65
commit 9556005425
1 changed files with 4 additions and 2 deletions

View File

@ -155,8 +155,10 @@ following is done:
be thrown away, and when next accessed it will be reloaded with the value of be thrown away, and when next accessed it will be reloaded with the value of
``obj.author_id``. ``obj.author_id``.
Note that only fields of the model are reloaded from the database. Other Only fields of the model are reloaded from the database. Other
database dependent values such as annotations are not reloaded. database-dependent values such as annotations aren't reloaded. Any
:func:`@cached_property <django.utils.functional.cached_property>` attributes
aren't cleared either.
The reloading happens from the database the instance was loaded from, or from The reloading happens from the database the instance was loaded from, or from
the default database if the instance wasn't loaded from the database. The the default database if the instance wasn't loaded from the database. The