mirror of
https://github.com/django/django.git
synced 2025-09-17 07:55:33 +00:00
Fixed #27555 -- Removed django.utils.functional.lazy_property.
This commit is contained in:
parent
05d2c5a66d
commit
71609a5b90
3 changed files with 3 additions and 41 deletions
|
@ -412,27 +412,6 @@ class SimpleLazyObject(LazyObject):
|
|||
return copy.deepcopy(self._wrapped, memo)
|
||||
|
||||
|
||||
class lazy_property(property):
|
||||
"""
|
||||
A property that works with subclasses by wrapping the decorated
|
||||
functions of the base class.
|
||||
"""
|
||||
def __new__(cls, fget=None, fset=None, fdel=None, doc=None):
|
||||
if fget is not None:
|
||||
@wraps(fget)
|
||||
def fget(instance, instance_type=None, name=fget.__name__):
|
||||
return getattr(instance, name)()
|
||||
if fset is not None:
|
||||
@wraps(fset)
|
||||
def fset(instance, value, name=fset.__name__):
|
||||
return getattr(instance, name)(value)
|
||||
if fdel is not None:
|
||||
@wraps(fdel)
|
||||
def fdel(instance, name=fdel.__name__):
|
||||
return getattr(instance, name)()
|
||||
return property(fget, fset, fdel, doc)
|
||||
|
||||
|
||||
def partition(predicate, values):
|
||||
"""
|
||||
Splits the values into two sets, based on the return value of the function
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue