summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
Diffstat (limited to 'docs')
-rw-r--r--docs/releases/1.4.txt6
-rw-r--r--docs/topics/http/urls.txt20
2 files changed, 26 insertions, 0 deletions
diff --git a/docs/releases/1.4.txt b/docs/releases/1.4.txt
index a63fff7295..e86e07031a 100644
--- a/docs/releases/1.4.txt
+++ b/docs/releases/1.4.txt
@@ -37,6 +37,12 @@ compatibility with old browsers, this change means that you can use any HTML5
features you need in admin pages without having to lose HTML validity or
override the provided templates to change the doctype.
+``reverse_lazy``
+~~~~~~~~~~~~~~~~
+
+A lazily evaluated version of :func:`django.core.urlresolvers.reverse` was
+added to allow using URL reversals before the project's URLConf gets loaded.
+
.. _backwards-incompatible-changes-1.4:
Backwards incompatible changes in 1.4
diff --git a/docs/topics/http/urls.txt b/docs/topics/http/urls.txt
index d721012d3e..ae1ca3f254 100644
--- a/docs/topics/http/urls.txt
+++ b/docs/topics/http/urls.txt
@@ -827,6 +827,26 @@ namespaces into URLs on specific application instances, according to the
``urllib.quote``) to the ouput of :meth:`~django.core.urlresolvers.reverse`
may produce undesirable results.
+reverse_lazy()
+--------------
+
+.. versionadded:: 1.4
+
+A lazily evaluated version of `reverse()`_.
+
+It is useful for when you need to use a URL reversal before your project's
+URLConf is loaded. Some common cases where this method is necessary are::
+
+* providing a reversed URL as the ``url`` attribute of a generic class-based
+ view.
+
+* providing a reversed URL to a decorator (such as the ``login_url`` argument
+ for the :func:`django.contrib.auth.decorators.permission_required`
+ decorator).
+
+* providing a reversed URL as a default value for a parameter in a function's
+ signature.
+
resolve()
---------