aboutsummaryrefslogtreecommitdiffstats
path: root/djangorestframework/compat.py
diff options
context:
space:
mode:
authorTom Christie2012-02-21 20:47:55 +0000
committerTom Christie2012-02-21 20:47:55 +0000
commitca9465f11e3310b7b1e18cd893e96b69963f68c9 (patch)
treef6e0221b7ed7d5156962099444350d2018bf1aac /djangorestframework/compat.py
parentb7c06dd8e37fa88ec055831b650967d76e1b78af (diff)
downloaddjango-rest-framework-ca9465f11e3310b7b1e18cd893e96b69963f68c9.tar.bz2
reverse gets it's own module
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)