aboutsummaryrefslogtreecommitdiffstats
path: root/djangorestframework/compat.py
diff options
context:
space:
mode:
authorTom Christie2012-02-21 20:57:36 +0000
committerTom Christie2012-02-21 20:57:36 +0000
commit5fd4c639d7c64572dd07dc31dcd627bed9469b05 (patch)
treed7cf3ba46e76937176f81e1ebc334bc790e7026c /djangorestframework/compat.py
parentaf9e4f69d732cc643d6ec7ae13d4a19ac0332d44 (diff)
downloaddjango-rest-framework-5fd4c639d7c64572dd07dc31dcd627bed9469b05.tar.bz2
Merge master into develop
Diffstat (limited to 'djangorestframework/compat.py')
-rw-r--r--djangorestframework/compat.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/djangorestframework/compat.py b/djangorestframework/compat.py
index 7690316c..b818b446 100644
--- a/djangorestframework/compat.py
+++ b/djangorestframework/compat.py
@@ -457,3 +457,11 @@ except ImportError: # python < 2.7
return decorator
unittest.skip = skip
+
+# reverse_lazy (Django 1.4 onwards)
+try:
+ from django.core.urlresolvers import reverse_lazy
+except:
+ from django.core.urlresolvers import reverse
+ from django.utils.functional import lazy
+ reverse_lazy = lazy(reverse, str)