1
0
mirror of https://github.com/django/django.git synced 2025-10-24 22:26:08 +00:00

Fixed #30876 -- Moved classproperty() decorator to the django.utils.functional.

This commit is contained in:
André Ericson
2019-10-18 21:00:34 +02:00
committed by Mariusz Felisiak
parent 31174031f1
commit 3120490912
8 changed files with 56 additions and 55 deletions

View File

@@ -49,6 +49,18 @@ class cached_property:
return res
class classproperty:
def __init__(self, method=None):
self.fget = method
def __get__(self, instance, cls=None):
return self.fget(cls)
def getter(self, method):
self.fget = method
return self
class Promise:
"""
Base class for the proxy class created in the closure of the lazy function.