mirror of
				https://github.com/django/django.git
				synced 2025-10-31 01:25:32 +00:00 
			
		
		
		
	[1.8.x] Fixed #25727 -- Added a doc link to cached_property.
Backport of e0de82c9b2 from master
			
			
This commit is contained in:
		| @@ -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 | 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. | that function is expensive, then doing so can be wasteful. | ||||||
|  |  | ||||||
| Using the ``@cached_property`` decorator saves the value returned by a | Using the :class:`~django.utils.functional.cached_property` decorator saves the | ||||||
| property; the next time the function is called on that instance, it will return | value returned by a property; the next time the function is called on that | ||||||
| the saved value rather than re-computing it. Note that this only works on | instance, it will return the saved value rather than re-computing it. Note that | ||||||
| methods that take ``self`` as their only argument and that it changes the | this only works on methods that take ``self`` as their only argument and that | ||||||
| method to a property. | it changes the method to a property. | ||||||
|  |  | ||||||
| Certain Django components also have their own caching functionality; these are | Certain Django components also have their own caching functionality; these are | ||||||
| discussed below in the sections related to those components. | discussed below in the sections related to those components. | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user