Fixed #25727 -- Added a doc link to cached_property.

This commit is contained in:
Tim Graham 2015-11-10 13:27:46 -05:00
parent 4608573788
commit e0de82c9b2
1 changed files with 5 additions and 5 deletions

View File

@ -174,11 +174,11 @@ final steps towards producing well-performing code, not a shortcut.
It's common to have to call a class instances's method more than once. If
that function is expensive, then doing so can be wasteful.
Using the ``@cached_property`` decorator saves the value returned by a
property; the next time the function is called on that instance, it will return
the saved value rather than re-computing it. Note that this only works on
methods that take ``self`` as their only argument and that it changes the
method to a property.
Using the :class:`~django.utils.functional.cached_property` decorator saves the
value returned by a property; the next time the function is called on that
instance, it will return the saved value rather than re-computing it. Note that
this only works on methods that take ``self`` as their only argument and that
it changes the method to a property.
Certain Django components also have their own caching functionality; these are
discussed below in the sections related to those components.