From ca9465f11e3310b7b1e18cd893e96b69963f68c9 Mon Sep 17 00:00:00 2001 From: Tom Christie Date: Tue, 21 Feb 2012 20:47:55 +0000 Subject: reverse gets it's own module --- djangorestframework/compat.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'djangorestframework/compat.py') 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) -- cgit v1.2.3