Commits

Andrew Godwin committed 09d357f

Fix 1.4-only line that snuck in

  • Participants
  • Parent commits 00074f0

Comments (0)

Files changed (1)

south/db/generic.py

 from django.dispatch import dispatcher
 from django.conf import settings
 from django.utils.datastructures import SortedDict
-from django.utils.functional import cached_property
+try:
+    from django.utils.functional import cached_property
+except ImportError:
+   class cached_property(object):
+       """
+       Decorator that creates converts a method with a single
+       self argument into a property cached on the instance.
+       """
+       def __init__(self, func):
+           self.func = func
+
+       def __get__(self, instance, type):
+           res = instance.__dict__[self.func.__name__] = self.func(instance)
+           return res
 
 from south.logger import get_logger