summaryrefslogtreecommitdiff
path: root/django
diff options
context:
space:
mode:
authorHonza Kral <honza.kral@gmail.com>2013-02-23 23:32:09 +0100
committerHonza Kral <honza.kral@gmail.com>2013-02-23 23:32:09 +0100
commitef1e6ef1eb5495b168f9fc642eca235e71e51dde (patch)
tree482a380aeed837426bfa54d3c7fbf315d12f108f /django
parent2b48fcc607010065c0f8107baf669dd41b164f3c (diff)
parentb88abd684041ffa66bfe445e1ac26164e803d488 (diff)
Merge branch 'ticket19872' of https://github.com/oinopion/django
Diffstat (limited to 'django')
-rw-r--r--django/utils/functional.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/django/utils/functional.py b/django/utils/functional.py
index 1b5200c98c..51001ea655 100644
--- a/django/utils/functional.py
+++ b/django/utils/functional.py
@@ -39,7 +39,9 @@ class cached_property(object):
def __init__(self, func):
self.func = func
- def __get__(self, instance, type):
+ def __get__(self, instance, type=None):
+ if instance is None:
+ return self
res = instance.__dict__[self.func.__name__] = self.func(instance)
return res