class documentation

class cached_property:

View In Hierarchy

Decorator that converts a method with a single self argument into a property cached on the instance.

A cached property can be made out of an existing method: (e.g. url = cached_property(get_absolute_url)). The optional name argument is obsolete as of Python 3.6 and will be deprecated in Django 4.0 (#30127).

Static Method func Undocumented
Method __get__ Call the function and put the return value in instance.__dict__ so that subsequent attribute access on the instance returns the cached value instead of calling cached_property.__get__().
Method __init__ Undocumented
Method __set​_name__ Undocumented
Instance Variable name Undocumented
Instance Variable real​_func Undocumented
@staticmethod
def func(instance):

Undocumented

def __get__(self, instance, cls=None):
Call the function and put the return value in instance.__dict__ so that subsequent attribute access on the instance returns the cached value instead of calling cached_property.__get__().
def __init__(self, func, name=None):

Undocumented

def __set_name__(self, owner, name):

Undocumented

name =

Undocumented

real_func =

Undocumented