summaryrefslogtreecommitdiff
path: root/docs/topics
diff options
context:
space:
mode:
authorJannis Leidel <jannis@leidel.info>2011-04-29 11:49:59 +0000
committerJannis Leidel <jannis@leidel.info>2011-04-29 11:49:59 +0000
commit79afd552788400bbcb8d399df1336ec7100eabd9 (patch)
treee8522e4d151f2122324a760d51fa1addc90a0b4f /docs/topics
parentf459169170910c3d94ee916ed79e2b9ff48915a2 (diff)
Fixed #5925 -- Added new lazily evaluated version of django.core.urlresolvers.reverse. Thanks, SmileyChris, Preston Timmons and Julien Phalip.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16121 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'docs/topics')
-rw-r--r--docs/topics/http/urls.txt20
1 files changed, 20 insertions, 0 deletions
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()
---------